diff options
| author | Brett Cannon <brett@python.org> | 2013-06-15 02:26:30 (GMT) |
|---|---|---|
| committer | Brett Cannon <brett@python.org> | 2013-06-15 02:26:30 (GMT) |
| commit | a3c96154d2a8d3dd0023b927a99b485e574c9922 (patch) | |
| tree | bdbc356425aa360bbbbdc2d816147a8940ef1723 /Lib/importlib/_bootstrap.py | |
| parent | 15e489f7c54a3ca5e631b7bfaf26e85daf0547bb (diff) | |
| download | cpython-a3c96154d2a8d3dd0023b927a99b485e574c9922.zip cpython-a3c96154d2a8d3dd0023b927a99b485e574c9922.tar.gz cpython-a3c96154d2a8d3dd0023b927a99b485e574c9922.tar.bz2 | |
Issue #17907: touch up the code for imp.new_module().
Diffstat (limited to 'Lib/importlib/_bootstrap.py')
| -rw-r--r-- | Lib/importlib/_bootstrap.py | 11 |
1 files changed, 1 insertions, 10 deletions
diff --git a/Lib/importlib/_bootstrap.py b/Lib/importlib/_bootstrap.py index 4558054..1276ff1 100644 --- a/Lib/importlib/_bootstrap.py +++ b/Lib/importlib/_bootstrap.py @@ -121,15 +121,6 @@ def _wrap(new, old): _code_type = type(_wrap.__code__) -def new_module(name): - """Create a new module. - - The module is not entered into sys.modules. - - """ - return type(_io)(name) - - # Module-level locking ######################################################## # A dict mapping module names to weakrefs of _ModuleLock instances @@ -509,7 +500,7 @@ class _ModuleManager: # This must be done before open() is called as the 'io' module # implicitly imports 'locale' and would otherwise trigger an # infinite loop. - self._module = new_module(self._name) + self._module = type(_io)(self._name) # This must be done before putting the module in sys.modules # (otherwise an optimization shortcut in import.c becomes wrong) self._module.__initializing__ = True |
