summaryrefslogtreecommitdiffstats
path: root/Tools/freeze
diff options
context:
space:
mode:
authorEric Snow <ericsnowcurrently@gmail.com>2021-10-28 21:04:33 (GMT)
committerGitHub <noreply@github.com>2021-10-28 21:04:33 (GMT)
commit074fa5750640a067d9894c69378a00ceecc3b948 (patch)
tree9635b7a42f48ca862af8dfc3fd4721bc1218bb17 /Tools/freeze
parent66e6b3dcd3bbab06feeff2cbaf8aade7b6223d6c (diff)
downloadcpython-074fa5750640a067d9894c69378a00ceecc3b948.zip
cpython-074fa5750640a067d9894c69378a00ceecc3b948.tar.gz
cpython-074fa5750640a067d9894c69378a00ceecc3b948.tar.bz2
bpo-45395: Make custom frozen modules additions instead of replacements. (gh-28778)
Currently custom modules (the array set on PyImport_FrozenModules) replace all the frozen stdlib modules. That can be problematic and is unlikely to be what the user wants. This change treats the custom frozen modules as additions instead. They take precedence over all other frozen modules except for those needed to bootstrap the import system. If the "code" field of an entry in the custom array is NULL then that frozen module is treated as disabled, which allows a custom entry to disable a frozen stdlib module. This change allows us to get rid of is_essential_frozen_module() and simplifies the logic for which frozen modules should be ignored. https://bugs.python.org/issue45395
Diffstat (limited to 'Tools/freeze')
-rwxr-xr-xTools/freeze/freeze.py6
1 files changed, 0 insertions, 6 deletions
diff --git a/Tools/freeze/freeze.py b/Tools/freeze/freeze.py
index d66e1e2..bc5e43f 100755
--- a/Tools/freeze/freeze.py
+++ b/Tools/freeze/freeze.py
@@ -367,12 +367,6 @@ def main():
else:
mf.load_file(mod)
- # Alias "importlib._bootstrap" to "_frozen_importlib" so that the
- # import machinery can bootstrap. Do the same for
- # importlib._bootstrap_external.
- mf.modules["_frozen_importlib"] = mf.modules["importlib._bootstrap"]
- mf.modules["_frozen_importlib_external"] = mf.modules["importlib._bootstrap_external"]
-
# Add the main script as either __main__, or the actual module name.
if python_entry_is_main:
mf.run_script(scriptfile)