summaryrefslogtreecommitdiffstats
path: root/Lib/plat-mac/bundlebuilder.py
diff options
context:
space:
mode:
authorJust van Rossum <just@letterror.com>2003-02-26 11:27:56 (GMT)
committerJust van Rossum <just@letterror.com>2003-02-26 11:27:56 (GMT)
commit0ff7a4e7c17ea3036ea941cc6ecbd67b0b49997b (patch)
treec393aa33a7460a5cc6f3a9c393c588b129836ac9 /Lib/plat-mac/bundlebuilder.py
parentddf5283ad148051b9e51c3a6ccd2074923431cc9 (diff)
downloadcpython-0ff7a4e7c17ea3036ea941cc6ecbd67b0b49997b.zip
cpython-0ff7a4e7c17ea3036ea941cc6ecbd67b0b49997b.tar.gz
cpython-0ff7a4e7c17ea3036ea941cc6ecbd67b0b49997b.tar.bz2
use the same Python for running the bootstrap script and the main program
Diffstat (limited to 'Lib/plat-mac/bundlebuilder.py')
-rwxr-xr-xLib/plat-mac/bundlebuilder.py10
1 files changed, 9 insertions, 1 deletions
diff --git a/Lib/plat-mac/bundlebuilder.py b/Lib/plat-mac/bundlebuilder.py
index 8987ef0..8502f81 100755
--- a/Lib/plat-mac/bundlebuilder.py
+++ b/Lib/plat-mac/bundlebuilder.py
@@ -266,7 +266,7 @@ STRIP_EXEC = "/usr/bin/strip"
# sys.executable later.
#
BOOTSTRAP_SCRIPT = """\
-#!/usr/bin/env python
+#!%(hashbang)s
import sys, os
execdir = os.path.dirname(sys.argv[0])
@@ -423,6 +423,14 @@ class AppBuilder(BundleBuilder):
execdir = pathjoin(self.bundlepath, self.execdir)
bootstrappath = pathjoin(execdir, self.name)
makedirs(execdir)
+ if self.standalone:
+ # XXX we're screwed when the end user has deleted
+ # /usr/bin/python
+ hashbang = "/usr/bin/python"
+ else:
+ hashbang = sys.executable
+ while os.path.islink(hashbang):
+ hashbang = os.readlink(hashbang)
open(bootstrappath, "w").write(BOOTSTRAP_SCRIPT % locals())
os.chmod(bootstrappath, 0775)