summaryrefslogtreecommitdiffstats
path: root/Tools/freeze/freeze.py
diff options
context:
space:
mode:
Diffstat (limited to 'Tools/freeze/freeze.py')
-rwxr-xr-xTools/freeze/freeze.py18
1 files changed, 12 insertions, 6 deletions
diff --git a/Tools/freeze/freeze.py b/Tools/freeze/freeze.py
index a41267a..e0c6c2c 100755
--- a/Tools/freeze/freeze.py
+++ b/Tools/freeze/freeze.py
@@ -125,7 +125,7 @@ def main():
# default the exclude list for each platform
if win: exclude = exclude + [
'dos', 'dospath', 'mac', 'macpath', 'macfs', 'MACFS', 'posix',
- 'os2', 'ce',
+ 'ce',
]
fail_import = exclude[:]
@@ -219,6 +219,7 @@ def main():
# locations derived from options
version = sys.version[:3]
+ flagged_version = version + sys.abiflags
if win:
extensions_c = 'frozen_extensions.c'
if ishome:
@@ -233,10 +234,11 @@ def main():
frozendllmain_c = os.path.join(exec_prefix, 'Pc\\frozen_dllmain.c')
else:
binlib = os.path.join(exec_prefix,
- 'lib', 'python%s' % version, 'config')
- incldir = os.path.join(prefix, 'include', 'python%s' % version)
+ 'lib', 'python%s' % version,
+ 'config-%s' % flagged_version)
+ incldir = os.path.join(prefix, 'include', 'python%s' % flagged_version)
config_h_dir = os.path.join(exec_prefix, 'include',
- 'python%s' % version)
+ 'python%s' % flagged_version)
config_c_in = os.path.join(binlib, 'config.c.in')
frozenmain_c = os.path.join(binlib, 'frozenmain.c')
makefile_in = os.path.join(binlib, 'Makefile')
@@ -311,7 +313,7 @@ def main():
try:
os.mkdir(odir)
print("Created output directory", odir)
- except os.error as msg:
+ except OSError as msg:
usage('%s: mkdir failed (%s)' % (odir, str(msg)))
base = ''
if odir:
@@ -363,6 +365,10 @@ def main():
else:
mf.load_file(mod)
+ # Alias "importlib._bootstrap" to "_frozen_importlib" so that the
+ # import machinery can bootstrap.
+ mf.modules["_frozen_importlib"] = mf.modules["importlib._bootstrap"]
+
# Add the main script as either __main__, or the actual module name.
if python_entry_is_main:
mf.run_script(scriptfile)
@@ -455,7 +461,7 @@ def main():
cflags = ['$(OPT)']
cppflags = defines + includes
- libs = [os.path.join(binlib, 'libpython$(VERSION).a')]
+ libs = [os.path.join(binlib, '$(LDLIBRARY)')]
somevars = {}
if os.path.exists(makefile_in):