mirror of https://github.com/python/cpython
Fix for last commit on adding reset_name to module_to_load
This commit is contained in:
parent
b60a43eabf
commit
c29cb41822
|
@ -529,10 +529,13 @@ class _ModuleManager:
|
||||||
del sys.modules[self._name]
|
del sys.modules[self._name]
|
||||||
|
|
||||||
|
|
||||||
def module_to_load(name):
|
def module_to_load(name, *, reset_name=True):
|
||||||
"""Return a context manager which provides the module object to load."""
|
"""Return a context manager which provides the module object to load.
|
||||||
|
|
||||||
|
If reset_name is true, reset the module's __name__ to 'name'.
|
||||||
|
"""
|
||||||
# Hiding _ModuleManager behind a function for better naming.
|
# Hiding _ModuleManager behind a function for better naming.
|
||||||
return _ModuleManager(name)
|
return _ModuleManager(name, reset_name=reset_name)
|
||||||
|
|
||||||
|
|
||||||
def set_package(fxn):
|
def set_package(fxn):
|
||||||
|
|
Loading…
Reference in New Issue