summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNed Deily <nad@acm.org>2012-08-17 13:22:30 -0700
committerNed Deily <nad@acm.org>2012-08-17 13:22:30 -0700
commit6aaa03a9015cac1c1a7ce98b2531c106a15c9de0 (patch)
tree7b2674ba624698c8c968c50cc04dc501864020a1
parentbbfe573d9d5fbae478199ccff07c39f5b2de499d (diff)
downloadcpython-git-6aaa03a9015cac1c1a7ce98b2531c106a15c9de0.tar.gz
Issue #15678: Fix menu customization for IDLE started from OS X
command lines. It was broken as a side effect of the changes to pythonw.c in b79d276041a8 for #15307. Since sys.executable no longer includes 'Python.app' in the path name, test for a framework build instead. This should give the previous behavior in nearly all cases. Whether the previous behavior is sensible is left as an issue for later releases. IDLE.app behavior was not affected as it does its own manipulation of sys.executable.
-rw-r--r--Lib/idlelib/macosxSupport.py16
-rw-r--r--Misc/NEWS3
2 files changed, 16 insertions, 3 deletions
diff --git a/Lib/idlelib/macosxSupport.py b/Lib/idlelib/macosxSupport.py
index 96904429af..67069fa0f3 100644
--- a/Lib/idlelib/macosxSupport.py
+++ b/Lib/idlelib/macosxSupport.py
@@ -12,12 +12,22 @@ _appbundle = None
def runningAsOSXApp():
"""
Returns True if Python is running from within an app on OSX.
- If so, assume that Python was built with Aqua Tcl/Tk rather than
- X11 Tcl/Tk.
+ If so, the various OS X customizations will be triggered later (menu
+ fixup, et al). (Originally, this test was supposed to condition
+ behavior on whether IDLE was running under Aqua Tk rather than
+ under X11 Tk but that does not work since a framework build
+ could be linked with X11. For several releases, this test actually
+ differentiates between whether IDLE is running from a framework or
+ not. As a future enhancement, it should be considered whether there
+ should be a difference based on framework and any needed X11 adaptions
+ should be made dependent on a new function that actually tests for X11.)
"""
global _appbundle
if _appbundle is None:
- _appbundle = (sys.platform == 'darwin' and '.app' in sys.executable)
+ _appbundle = sys.platform == 'darwin'
+ if _appbundle:
+ import sysconfig
+ _appbundle = bool(sysconfig.get_config_var('PYTHONFRAMEWORK'))
return _appbundle
_carbonaquatk = None
diff --git a/Misc/NEWS b/Misc/NEWS
index 7e95b665b4..49a4057d9d 100644
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -29,6 +29,9 @@ Library
multiprocessing on Windows without the "if __name__ == '__main__'"
idiom.
+- Issue #15678: Fix IDLE menus when started from OS X command line
+ (3.3.0b2 regression).
+
C API
-----