mirror of
https://github.com/python/cpython.git
synced 2025-10-09 16:34:44 +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,7 +1723,9 @@ def _setup(sys_module, _imp_module):
|
|||
else:
|
||||
BYTECODE_SUFFIXES = DEBUG_BYTECODE_SUFFIXES
|
||||
|
||||
for module in (_imp, sys):
|
||||
module_type = type(sys)
|
||||
for module in sys.modules.values():
|
||||
if isinstance(module, module_type):
|
||||
if not hasattr(module, '__loader__'):
|
||||
module.__loader__ = BuiltinImporter
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue