cpython/Lib/test/test_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
..
builtin bpo-42135: Deprecate implementations of find_module() and find_loader() (GH-25169) 2021-04-06 08:56:57 -07:00
data
data01
data02
data03
extension bpo-42135: Deprecate implementations of find_module() and find_loader() (GH-25169) 2021-04-06 08:56:57 -07:00
frozen bpo-45020: Identify which frozen modules are actually aliases. (gh-28655) 2021-10-05 11:26:37 -06:00
import_ bpo-42135: Deprecate implementations of find_module() and find_loader() (GH-25169) 2021-04-06 08:56:57 -07:00
namespace_pkgs
namespacedata01 bpo-42129: Add support for resources in namespaces (GH-24670) 2021-03-04 13:43:00 -05:00
partial bpo-43517: Fix false positive in detection of circular imports (#24895) 2021-03-20 20:07:44 +01:00
resources bpo-44771: Apply changes from importlib_resources 5.2.1 (GH-27436) 2021-07-29 21:05:05 -04:00
source [codemod] Fix non-matching bracket pairs (GH-28473) 2021-09-22 01:09:00 +02:00
zipdata01 bpo-42129: Add support for resources in namespaces (GH-24670) 2021-03-04 13:43:00 -05:00
zipdata02 bpo-42129: Add support for resources in namespaces (GH-24670) 2021-03-04 13:43:00 -05:00
__init__.py
__main__.py
abc.py
fixtures.py bpo-43926: Cleaner metadata with PEP 566 JSON support. (GH-25565) 2021-05-02 17:03:40 -04:00
stubs.py
test_abc.py bpo-42135: Deprecate implementations of find_module() and find_loader() (GH-25169) 2021-04-06 08:56:57 -07:00
test_api.py bpo-42135: Deprecate implementations of find_module() and find_loader() (GH-25169) 2021-04-06 08:56:57 -07:00
test_compatibilty_files.py bpo-44771: Apply changes from importlib_resources 5.2.1 (GH-27436) 2021-07-29 21:05:05 -04:00
test_contents.py bpo-44771: Apply changes from importlib_resources 5.2.1 (GH-27436) 2021-07-29 21:05:05 -04:00
test_files.py bpo-44771: Apply changes from importlib_resources 5.2.1 (GH-27436) 2021-07-29 21:05:05 -04:00
test_lazy.py
test_locks.py bpo-45229: Remove test_main in many tests (GH-28405) 2021-09-19 15:27:33 +03:00
test_main.py bpo-43926: Cleaner metadata with PEP 566 JSON support. (GH-25565) 2021-05-02 17:03:40 -04:00
test_metadata_api.py bpo-44784: Apply changes from importlib_metadata 4.6.3 (GH-27508) 2021-07-31 06:08:13 -07:00
test_namespace_pkgs.py bpo-42136: Deprecate module_repr() as found in importlib (GH-25022) 2021-03-26 11:55:07 -07:00
test_open.py bpo-44771: Apply changes from importlib_resources 5.2.1 (GH-27436) 2021-07-29 21:05:05 -04:00
test_path.py bpo-44771: Apply changes from importlib_resources 5.2.1 (GH-27436) 2021-07-29 21:05:05 -04:00
test_pkg_import.py bpo-43651: PEP 597: Fix EncodingWarning in some tests (GH-25181) 2021-04-05 13:11:23 +09:00
test_read.py bpo-44771: Apply changes from importlib_resources 5.2.1 (GH-27436) 2021-07-29 21:05:05 -04:00
test_reader.py bpo-38693: Prefer f-strings in importlib.resources (importlib_resources 5.0.6). (GH-26387) 2021-05-26 13:16:11 -07:00
test_resource.py bpo-44771: Apply changes from importlib_resources 5.2.1 (GH-27436) 2021-07-29 21:05:05 -04:00
test_spec.py bpo-43105: Importlib now resolves relative paths when creating module spec objects from file locations (GH-25121) 2021-04-07 01:02:07 +01:00
test_threaded_import.py bpo-45229: Remove test_main in many tests (GH-28405) 2021-09-19 15:27:33 +03:00
test_util.py bpo-43672: raise ImportWarning when calling find_loader() (GH-25119) 2021-04-02 12:35:32 -07:00
test_windows.py bpo-43864: Silence deprecation warning in test_importlib.test_module_found and test_importlib.test_module_not_found (GH-25656) 2021-04-27 16:56:08 +01:00
test_zip.py bpo-44246: Entry points performance improvements. (GH-26467) 2021-05-31 11:52:29 -04:00
threaded_import_hangers.py
update-zips.py bpo-42129: Add support for resources in namespaces (GH-24670) 2021-03-04 13:43:00 -05:00
util.py bpo-44771: Apply changes from importlib_resources 5.2.1 (GH-27436) 2021-07-29 21:05:05 -04:00