Issue #16047: Fix module exception list and __file__ handling in freeze. · pythoncapi/cpython@c00d39e · GitHub
Skip to content

Commit c00d39e

Browse files
committed
Issue python#16047: Fix module exception list and __file__ handling in freeze.
Patch by Meador Inge.
1 parent 3a43403 commit c00d39e

4 files changed

Lines changed: 16 additions & 4 deletions

File tree

Lib/site.py

Lines changed: 8 additions & 3 deletions

Misc/NEWS

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,9 @@ Tests
137137
Tools/Demos
138138
-----------
139139

140+
- Issue #16047: Fix module exception list and __file__ handling in freeze.
141+
Patch by Meador Inge.
142+
140143
- Issue #11824: Consider ABI tags in freeze. Patch by Meador Inge.
141144

142145
- Issue #20535: PYTHONWARNING no longer affects the run_tests.py script.

Tools/freeze/freeze.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -365,6 +365,10 @@ def main():
365365
else:
366366
mf.load_file(mod)
367367

368+
# Alias "importlib._bootstrap" to "_frozen_importlib" so that the
369+
# import machinery can bootstrap.
370+
mf.modules["_frozen_importlib"] = mf.modules["importlib._bootstrap"]
371+
368372
# Add the main script as either __main__, or the actual module name.
369373
if python_entry_is_main:
370374
mf.run_script(scriptfile)

Tools/freeze/makeconfig.py

Lines changed: 1 addition & 1 deletion

0 commit comments

Comments
 (0)