Skip to content

Commit 27c72e9

Browse files
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.
1 parent 98bc31f commit 27c72e9

2 files changed

Lines changed: 11 additions & 0 deletions

File tree

‎Mac/Tools/pythonw.c‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,14 @@ int
149149
main(int argc, char **argv) {
150150
char* exec_path = get_python_path();
151151

152+
/*
153+
* Let argv[0] refer to the new interpreter. This is needed to
154+
* get the effect we want on OSX 10.5 or earlier. That is, without
155+
* changing argv[0] the real interpreter won't have access to
156+
* the Window Server.
157+
*/
158+
argv[0] = exec_path;
159+
152160
#ifdef HAVE_SPAWN_H
153161

154162
/* We're weak-linking to posix-spawnv to ensure that

‎Misc/NEWS‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,9 @@ Core and Builtins
3232
- Issue #7079: Fix a possible crash when closing a file object while using it
3333
from another thread. Patch by Daniel Stutzbach.
3434

35+
- Issue #8868: Fix that ensures that python scripts have access to the
36+
Window Server again in a framework build on MacOSX 10.5 or earlier.
37+
3538
C-API
3639
-----
3740

0 commit comments

Comments
 (0)