Merged revisions 77031 via svnmerge from

svn+ssh://pythondev@svn.python.org/python/trunk

........
  r77031 | ronald.oussoren | 2009-12-24 14:30:58 +0100 (Thu, 24 Dec 2009) | 15 lines

  Issue #6834: replace the implementation for the 'python' and 'pythonw' executables on OSX.

  The previous implementation used execv(2) to run the real interpreter, which means that
  you cannot use the arch(1) tool to select the architecture you want to use for a
  universal build because that only affects the python/pythonw wrapper and not the actual
  interpreter.

  The new version uses posix_spawnv with a number of OSX-specific options that ensure that
  the real interpreter is started using the same CPU architecture as the wrapper, and that
  means that 'arch -ppc python' now actually works.

  I've also changed the way that the wrapper looks for the framework: it is now linked to
  the framework rather than hardcoding the framework path. This should make it easier to
  provide pythonw support in tools like virtualenv.
........
This commit is contained in:
Ronald Oussoren 2009-12-24 14:03:19 +00:00
parent ecc6081b3e
commit 6f6c562492
8 changed files with 265 additions and 118 deletions

View file

@ -5,13 +5,19 @@ GUI application (as opposed to an X11 application).
import sys
import tkinter
_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.
"""
return (sys.platform == 'darwin' and '.app' in sys.executable)
global _appbundle
if _appbundle is None:
_appbundle = (sys.platform == 'darwin' and '.app' in sys.executable)
return _appbundle
def addOpenEventSupport(root, flist):
"""