summaryrefslogtreecommitdiff
path: root/Mac
diff options
context:
space:
mode:
authorRonald Oussoren <ronaldoussoren@mac.com>2006-06-07 20:18:44 +0000
committerRonald Oussoren <ronaldoussoren@mac.com>2006-06-07 20:18:44 +0000
commitf2ee09400329fc9090bacd702e1247f8cd68562f (patch)
treee433f863082020a43abeaa84b3587ae23779ef4e /Mac
parentab84facf0c4d90dac74aea0b180210e1748336c6 (diff)
downloadcpython-f2ee09400329fc9090bacd702e1247f8cd68562f.tar.gz
* 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')
-rw-r--r--Mac/scripts/BuildApplet.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/Mac/scripts/BuildApplet.py b/Mac/scripts/BuildApplet.py
index 756218f1ff..ae5e3a3270 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()