cpython/Lib/importlib
Eric Snow 08285d563e
bpo-45020: Identify which frozen modules are actually aliases. (gh-28655)
In the list of generated frozen modules at the top of Tools/scripts/freeze_modules.py, you will find that some of the modules have a different name than the module (or .py file) that is actually frozen. Let's call each case an "alias". Aliases do not come into play until we get to the (generated) list of modules in Python/frozen.c. (The tool for freezing modules, Programs/_freeze_module, is only concerned with the source file, not the module it will be used for.)

Knowledge of which frozen modules are aliases (and the identity of the original module) normally isn't important. However, this information is valuable when we go to set __file__ on frozen stdlib modules. This change updates Tools/scripts/freeze_modules.py to map aliases to the original module name (or None if not a stdlib module) in Python/frozen.c. We also add a helper function in Python/import.c to look up a frozen module's alias and add the result of that function to the frozen info returned from find_frozen().

https://bugs.python.org/issue45020
2021-10-05 11:26:37 -06:00
..
metadata bpo-44464: Remove special exclusion for flake8 in the deprecation warnings. (#26807) 2021-06-27 17:59:18 -04:00
__init__.py bpo-42135 Correct version slated for importlib.find_loader removal (GH-28312) 2021-09-13 15:57:50 -07:00
_abc.py bpo-42136: Deprecate module_repr() as found in importlib (GH-25022) 2021-03-26 11:55:07 -07:00
_adapters.py bpo-44771: Apply changes from importlib_resources 5.2.1 (GH-27436) 2021-07-29 21:05:05 -04:00
_bootstrap.py bpo-45020: Identify which frozen modules are actually aliases. (gh-28655) 2021-10-05 11:26:37 -06:00
_bootstrap_external.py bpo-44530: Add co_qualname field to PyCodeObject (GH-26941) 2021-07-07 12:21:51 +01:00
_common.py bpo-44771: Sync with importlib_resources 5.2.2, fixing refleak. (#27497) 2021-07-30 20:37:09 -04:00
_itertools.py bpo-44771: Apply changes from importlib_resources 5.2.1 (GH-27436) 2021-07-29 21:05:05 -04:00
_legacy.py bpo-44771: Apply changes from importlib_resources 5.2.1 (GH-27436) 2021-07-29 21:05:05 -04:00
abc.py bpo-42135: Deprecate implementations of find_module() and find_loader() (GH-25169) 2021-04-06 08:56:57 -07:00
machinery.py bpo-42403: Fix pyflakes warnings in importlib (GH-23396) 2020-11-19 11:20:57 +01:00
readers.py bpo-44771: Apply changes from importlib_resources 5.2.1 (GH-27436) 2021-07-29 21:05:05 -04:00
resources.py bpo-44771: Apply changes from importlib_resources 5.2.1 (GH-27436) 2021-07-29 21:05:05 -04:00
simple.py bpo-44771: Apply changes from importlib_resources 5.2.1 (GH-27436) 2021-07-29 21:05:05 -04:00
util.py bpo-43720: Update import-related stdlib deprecation messages to say they will be removed in Python 3.12 (GH-25167) 2021-04-03 15:31:15 -07:00