mirror of
https://github.com/python/cpython.git
synced 2025-10-06 23:21:06 +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:
|
else:
|
||||||
BYTECODE_SUFFIXES = DEBUG_BYTECODE_SUFFIXES
|
BYTECODE_SUFFIXES = DEBUG_BYTECODE_SUFFIXES
|
||||||
|
|
||||||
for module in (_imp, sys):
|
module_type = type(sys)
|
||||||
if not hasattr(module, '__loader__'):
|
for module in sys.modules.values():
|
||||||
module.__loader__ = BuiltinImporter
|
if isinstance(module, module_type):
|
||||||
|
if not hasattr(module, '__loader__'):
|
||||||
|
module.__loader__ = BuiltinImporter
|
||||||
|
|
||||||
self_module = sys.modules[__name__]
|
self_module = sys.modules[__name__]
|
||||||
for builtin_name in ('_io', '_warnings', 'builtins', 'marshal'):
|
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
|
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 #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
|
- Issue #13886: Fix input() to not strip out input bytes that cannot be decoded
|
||||||
|
|
|
@ -1362,9 +1362,8 @@ PyErr_SetInterrupt(void)
|
||||||
void
|
void
|
||||||
PyOS_InitInterrupts(void)
|
PyOS_InitInterrupts(void)
|
||||||
{
|
{
|
||||||
PyObject *m = PyInit_signal();
|
PyObject *m = PyImport_ImportModule("signal");
|
||||||
if (m) {
|
if (m) {
|
||||||
_PyImport_FixupBuiltin(m, "signal");
|
|
||||||
Py_DECREF(m);
|
Py_DECREF(m);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue