diff Mac/Tools/pythonw.c @ 62027:34a637bfd4be

Merged revisions 81649 via svnmerge from svn+ssh://pythondev@svn.python.org/python/trunk ........ r81649 | ronald.oussoren | 2010-06-02 05:47:14 +0200 (Wed, 02 Jun 2010) | 5 lines 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:50:56 +0000
parents cab14be0ada1
children 81d7f78a633a
line wrap: on
line diff
--- a/Mac/Tools/pythonw.c	Wed Jun 02 02:29:00 2010 +0000
+++ b/Mac/Tools/pythonw.c	Wed Jun 02 03:50:56 2010 +0000
@@ -151,6 +151,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
      * an executable build on 10.5 can work on 10.4.