cpython/Lib/importlib
Eric Snow c3d9ac8b34
bpo-45324: Capture data in FrozenImporter.find_spec() to use in exec_module(). (gh-28633)
Before this change we end up duplicating effort and throwing away data in FrozenImporter.find_spec().  Now we do the work once in find_spec() and the only thing we do in FrozenImporter.exec_module() is turn the raw frozen data into a code object and then exec it.

We've added _imp.find_frozen(), add an arg to _imp.get_frozen_object(), and updated FrozenImporter.  We've also moved some code around to reduce duplication, get a little more consistency in outcomes, and be more efficient.

Note that this change is mostly necessary if we want to set __file__ on frozen stdlib modules. (See https://bugs.python.org/issue21736.)

https://bugs.python.org/issue45324
2021-10-05 10:01:27 -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-45324: Capture data in FrozenImporter.find_spec() to use in exec_module(). (gh-28633) 2021-10-05 10:01:27 -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