diff options
author | Brett Cannon <brett@python.org> | 2013-02-01 14:07:28 -0500 |
---|---|---|
committer | Brett Cannon <brett@python.org> | 2013-02-01 14:07:28 -0500 |
commit | 611afc1b3fd0183b1d386474ef5665cee43009ed (patch) | |
tree | 17c3e3acf8a7201406467a76cf0b9b6ec052eb0b | |
parent | d7be03aafab4b0a9ff9a3a1701220b380028862d (diff) | |
parent | 0ecd30b4af4f5bd3c9e884a608e0a256ffe8f5fa (diff) | |
download | cpython-git-611afc1b3fd0183b1d386474ef5665cee43009ed.tar.gz |
Issue #17098: all modules should have __loader__
-rw-r--r-- | Lib/importlib/_bootstrap.py | 8 | ||||
-rw-r--r-- | Misc/NEWS | 3 | ||||
-rw-r--r-- | Modules/signalmodule.c | 3 |
3 files changed, 9 insertions, 5 deletions
diff --git a/Lib/importlib/_bootstrap.py b/Lib/importlib/_bootstrap.py index 292c4e1e6a..8949365d51 100644 --- a/Lib/importlib/_bootstrap.py +++ b/Lib/importlib/_bootstrap.py @@ -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'): @@ -10,6 +10,9 @@ What's New in Python 3.4.0 Alpha 1? Core and Builtins ----------------- +- Issue #17098: All modules now have __loader__ set even if they pre-exist the + bootstrapping of importlib. + - Issue #16979: Fix error handling bugs in the unicode-escape-decode decoder. - Issue #13886: Fix input() to not strip out input bytes that cannot be decoded diff --git a/Modules/signalmodule.c b/Modules/signalmodule.c index bbaf9a3492..1e5ee274d4 100644 --- a/Modules/signalmodule.c +++ b/Modules/signalmodule.c @@ -1362,9 +1362,8 @@ PyErr_SetInterrupt(void) void PyOS_InitInterrupts(void) { - PyObject *m = PyInit_signal(); + PyObject *m = PyImport_ImportModule("signal"); if (m) { - _PyImport_FixupBuiltin(m, "signal"); Py_DECREF(m); } } |