MCPcopy Index your code
hub / github.com/RustPython/RustPython / __init__

Method __init__

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

Source from the content-addressed store, hash-verified

201 """
202
203 def __init__(self, *module_names, usefrozen=False):
204 self.original_modules = sys.modules.copy()
205 for module_name in module_names:
206 if module_name in sys.modules:
207 module = sys.modules[module_name]
208 # It is possible that module_name is just an alias for
209 # another module (e.g. stub for modules renamed in 3.x).
210 # In that case, we also need delete the real module to clear
211 # the import cache.
212 if module.__name__ != module_name:
213 del sys.modules[module.__name__]
214 del sys.modules[module_name]
215 self._frozen_modules = frozen_modules(usefrozen)
216
217 def __enter__(self):
218 self._frozen_modules.__enter__()

Callers

nothing calls this directly

Calls 2

frozen_modulesFunction · 0.85
copyMethod · 0.45

Tested by

no test coverage detected