diff options
author | Ronald Oussoren <ronaldoussoren@mac.com> | 2006-06-07 20:18:44 (GMT) |
---|---|---|
committer | Ronald Oussoren <ronaldoussoren@mac.com> | 2006-06-07 20:18:44 (GMT) |
commit | 4b7a6c8b587a15fd2b6d17e21ad63431503a5c9e (patch) | |
tree | 2ccf0e978ce800d76d486c500284b82528a484b7 /Mac/scripts | |
parent | 750e92043e0811fe990291d113ecca9650ac767c (diff) | |
download | cpython-4b7a6c8b587a15fd2b6d17e21ad63431503a5c9e.zip cpython-4b7a6c8b587a15fd2b6d17e21ad63431503a5c9e.tar.gz cpython-4b7a6c8b587a15fd2b6d17e21ad63431503a5c9e.tar.bz2 |
* If BuildApplet.py is used as an applet it starts with a version of
sys.exutable that isn't usuable on an #!-line. That results in generated
applets that don't actually work. Work around this problem by resetting
sys.executable.
* argvemulator.py didn't work on intel macs. This patch fixes this
(bug #1491468)
Diffstat (limited to 'Mac/scripts')
-rw-r--r-- | Mac/scripts/BuildApplet.py | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/Mac/scripts/BuildApplet.py b/Mac/scripts/BuildApplet.py index 756218f..ae5e3a3 100644 --- a/Mac/scripts/BuildApplet.py +++ b/Mac/scripts/BuildApplet.py @@ -16,6 +16,18 @@ import EasyDialogs import buildtools import getopt +if not sys.executable.startswith(sys.exec_prefix): + # Oh, the joys of using a python script to bootstrap applicatin bundles + # sys.executable points inside the current application bundle. Because this + # path contains blanks (two of them actually) this path isn't usable on + # #! lines. Reset sys.executable to point to the embedded python interpreter + sys.executable = os.path.join(sys.prefix, + 'Resources/Python.app/Contents/MacOS/Python') + + # Just in case we're not in a framework: + if not os.path.exists(sys.executable): + sys.executable = os.path.join(sys.exec_prefix, 'bin/python') + def main(): try: buildapplet() |