diff Mac/Tools/pythonw.c @ 62026:bd47cd1f9bc2 legacy-trunk

Fix for issue8868: without this patch 'MacOS.WMAvailable()' will return False on MacOSX 10.5 or earlier and scripts won't be able to access GUI functionality.
author Ronald Oussoren <ronaldoussoren@mac.com>
date Wed, 02 Jun 2010 03:47:14 +0000
parents fd25030223b0
children ee5350f1d0c2
line wrap: on
line diff
--- a/Mac/Tools/pythonw.c	Wed Jun 02 02:19:15 2010 +0000
+++ b/Mac/Tools/pythonw.c	Wed Jun 02 03:47:14 2010 +0000
@@ -149,6 +149,14 @@
 main(int argc, char **argv) {
     char* exec_path = get_python_path();
 
+    /*
+     * Let argv[0] refer to the new interpreter. This is needed to
+     * get the effect we want on OSX 10.5 or earlier. That is, without
+     * changing argv[0] the real interpreter won't have access to
+     * the Window Server.
+     */
+    argv[0] = exec_path;
+
 #ifdef HAVE_SPAWN_H
 
     /* We're weak-linking to posix-spawnv to ensure that