mirror of
https://github.com/python/cpython.git
synced 2025-11-01 06:01:29 +00:00
- 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.
This commit is contained in:
parent
6453c1f218
commit
888e100356
1 changed files with 8 additions and 2 deletions
|
|
@ -230,7 +230,12 @@ def report(self):
|
|||
|
||||
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 @@ def preProcess(self):
|
|||
os.chmod(bootstrappath, 0775)
|
||||
|
||||
def postProcess(self):
|
||||
self.addPythonModules()
|
||||
if self.standalone:
|
||||
self.addPythonModules()
|
||||
if self.strip and not self.symlink:
|
||||
self.stripBinaries()
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue