summaryrefslogtreecommitdiffstats
path: root/Mac
diff options
context:
space:
mode:
authorJust van Rossum <just@letterror.com>2002-11-30 19:56:14 (GMT)
committerJust van Rossum <just@letterror.com>2002-11-30 19:56:14 (GMT)
commit888e100356f831be7d01dbd0d1768bd8f4c85f14 (patch)
tree2d72021b1e91dbb868c5dd79580d6d70fe739992 /Mac
parent6453c1f218b53c4c68faa37cb15db81357c5e5dc (diff)
downloadcpython-888e100356f831be7d01dbd0d1768bd8f4c85f14.zip
cpython-888e100356f831be7d01dbd0d1768bd8f4c85f14.tar.gz
cpython-888e100356f831be7d01dbd0d1768bd8f4c85f14.tar.bz2
- found a case where sys.path[0] isn't set to Contents/Resources,
so search the entire path. - only add modules if we're building a standalone application.
Diffstat (limited to 'Mac')
-rwxr-xr-xMac/Lib/bundlebuilder.py10
1 files changed, 8 insertions, 2 deletions
diff --git a/Mac/Lib/bundlebuilder.py b/Mac/Lib/bundlebuilder.py
index a4811f1..d911292 100755
--- a/Mac/Lib/bundlebuilder.py
+++ b/Mac/Lib/bundlebuilder.py
@@ -230,7 +230,12 @@ SITE_CO = compile(SITE_PY, "<-bundlebuilder.py->", "exec")
EXT_LOADER = """\
import imp, sys, os
-path = os.path.join(sys.path[0], "%(filename)s")
+for p in sys.path:
+ path = os.path.join(p, "%(filename)s")
+ if os.path.exists(path):
+ break
+else:
+ assert 0, "file not found: %(filename)s"
mod = imp.load_dynamic("%(name)s", path)
sys.modules["%(name)s"] = mod
"""
@@ -361,7 +366,8 @@ class AppBuilder(BundleBuilder):
os.chmod(bootstrappath, 0775)
def postProcess(self):
- self.addPythonModules()
+ if self.standalone:
+ self.addPythonModules()
if self.strip and not self.symlink:
self.stripBinaries()