MCPcopy Index your code
hub / github.com/python/cpython / __init__

Method __init__

Lib/test/support/import_helper.py:215–227  ·  view source on GitHub ↗
(self, *module_names, usefrozen=False)

Source from the content-addressed store, hash-verified

213 """
214
215 def __init__(self, *module_names, usefrozen=False):
216 self.original_modules = sys.modules.copy()
217 for module_name in module_names:
218 if module_name in sys.modules:
219 module = sys.modules[module_name]
220 # It is possible that module_name is just an alias for
221 # another module (e.g. stub for modules renamed in 3.x).
222 # In that case, we also need delete the real module to clear
223 # the import cache.
224 if module.__name__ != module_name:
225 del sys.modules[module.__name__]
226 del sys.modules[module_name]
227 self._frozen_modules = frozen_modules(usefrozen)
228
229 def __enter__(self):
230 self._frozen_modules.__enter__()

Callers

nothing calls this directly

Calls 2

frozen_modulesFunction · 0.85
copyMethod · 0.45

Tested by

no test coverage detected