mirror of
https://github.com/python/cpython.git
synced 2025-08-27 04:05:34 +00:00
Issue #17907: touch up the code for imp.new_module().
This commit is contained in:
parent
15e489f7c5
commit
a3c96154d2
8 changed files with 3700 additions and 3558 deletions
13
Lib/imp.py
13
Lib/imp.py
|
@ -17,7 +17,6 @@ except ModuleNotFoundError:
|
|||
load_dynamic = None
|
||||
|
||||
# Directly exposed by this module
|
||||
from importlib._bootstrap import new_module
|
||||
from importlib._bootstrap import cache_from_source, source_from_cache
|
||||
|
||||
|
||||
|
@ -28,6 +27,7 @@ import importlib
|
|||
import os
|
||||
import sys
|
||||
import tokenize
|
||||
import types
|
||||
import warnings
|
||||
|
||||
|
||||
|
@ -44,6 +44,17 @@ PY_CODERESOURCE = 8
|
|||
IMP_HOOK = 9
|
||||
|
||||
|
||||
def new_module(name):
|
||||
"""**DEPRECATED**
|
||||
|
||||
Create a new module.
|
||||
|
||||
The module is not entered into sys.modules.
|
||||
|
||||
"""
|
||||
return types.ModuleType(name)
|
||||
|
||||
|
||||
def get_magic():
|
||||
"""**DEPRECATED**
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue