mirror of
https://github.com/python/cpython.git
synced 2025-08-04 17:08:35 +00:00
Issue #17098: all modules should have __loader__
This commit is contained in:
commit
611afc1b3f
3 changed files with 9 additions and 5 deletions
|
@ -1723,9 +1723,11 @@ def _setup(sys_module, _imp_module):
|
|||
else:
|
||||
BYTECODE_SUFFIXES = DEBUG_BYTECODE_SUFFIXES
|
||||
|
||||
for module in (_imp, sys):
|
||||
if not hasattr(module, '__loader__'):
|
||||
module.__loader__ = BuiltinImporter
|
||||
module_type = type(sys)
|
||||
for module in sys.modules.values():
|
||||
if isinstance(module, module_type):
|
||||
if not hasattr(module, '__loader__'):
|
||||
module.__loader__ = BuiltinImporter
|
||||
|
||||
self_module = sys.modules[__name__]
|
||||
for builtin_name in ('_io', '_warnings', 'builtins', 'marshal'):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue