]> granicus.if.org Git - python/commitdiff
Fix for issue8868: without this patch 'MacOS.WMAvailable()' will return
authorRonald Oussoren <ronaldoussoren@mac.com>
Wed, 2 Jun 2010 03:47:14 +0000 (03:47 +0000)
committerRonald Oussoren <ronaldoussoren@mac.com>
Wed, 2 Jun 2010 03:47:14 +0000 (03:47 +0000)
False on MacOSX 10.5 or earlier and scripts won't be able to access GUI
functionality.

Mac/Tools/pythonw.c
Misc/NEWS

index 7f45ca9ff62a1990aa3688945a0c74d6e1777d58..08e069b03cb43b51fa5cd14f80728c08cd37efa3 100644 (file)
@@ -149,6 +149,14 @@ int
 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
index 352ebf4e9ecf6d0ff100bc5869fcc98d56134cbd..4e0b0d2948608a77659aff5841dfcc867ff2c624 100644 (file)
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -32,6 +32,9 @@ Core and Builtins
 - Issue #7079: Fix a possible crash when closing a file object while using it
   from another thread.  Patch by Daniel Stutzbach.
 
+- Issue #8868: Fix that ensures that python scripts have access to the 
+  Window Server again in a framework build on MacOSX 10.5 or earlier.
+
 C-API
 -----