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

Function isolated_modules

Lib/test/support/import_helper.py:286–294  ·  view source on GitHub ↗

Save modules on entry and cleanup on exit.

()

Source from the content-addressed store, hash-verified

284
285@contextlib.contextmanager
286def isolated_modules():
287 """
288 Save modules on entry and cleanup on exit.
289 """
290 (saved,) = modules_setup()
291 try:
292 yield
293 finally:
294 modules_cleanup(saved)
295
296
297def mock_register_at_fork(func):

Callers

nothing calls this directly

Calls 2

modules_setupFunction · 0.85
modules_cleanupFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…