diff options
author | Brett Cannon <brett@python.org> | 2013-02-01 21:36:29 (GMT) |
---|---|---|
committer | Brett Cannon <brett@python.org> | 2013-02-01 21:36:29 (GMT) |
commit | 85ae3566d117df8f0ade3aa14a6ddda09711a663 (patch) | |
tree | 0c0fa3adacbe71bea2380abccca900017c3858f9 /Lib/importlib | |
parent | f41fa4f3a0b12161d8fcd58deb07756df929f405 (diff) | |
parent | da9cf0eef8c9cb338ad71330345423c9de2e0a01 (diff) | |
download | cpython-85ae3566d117df8f0ade3aa14a6ddda09711a663.zip cpython-85ae3566d117df8f0ade3aa14a6ddda09711a663.tar.gz cpython-85ae3566d117df8f0ade3aa14a6ddda09711a663.tar.bz2 |
Merge w/ 3.3 more fixes thanks to issue #17098
Diffstat (limited to 'Lib/importlib')
-rw-r--r-- | Lib/importlib/_bootstrap.py | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/Lib/importlib/_bootstrap.py b/Lib/importlib/_bootstrap.py index 8949365..6b2221d 100644 --- a/Lib/importlib/_bootstrap.py +++ b/Lib/importlib/_bootstrap.py @@ -1724,10 +1724,13 @@ def _setup(sys_module, _imp_module): BYTECODE_SUFFIXES = DEBUG_BYTECODE_SUFFIXES module_type = type(sys) - for module in sys.modules.values(): + for name, module in sys.modules.items(): if isinstance(module, module_type): if not hasattr(module, '__loader__'): - module.__loader__ = BuiltinImporter + if name in sys.builtin_module_names: + module.__loader__ = BuiltinImporter + elif _imp.is_frozen(name): + module.__loader__ = FrozenImporter self_module = sys.modules[__name__] for builtin_name in ('_io', '_warnings', 'builtins', 'marshal'): |