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

Function frozen_modules

Lib/test/support/import_helper.py:109–119  ·  view source on GitHub ↗

Force frozen modules to be used (or not). This only applies to modules that haven't been imported yet. Also, some essential modules will always be imported frozen.

(enabled=True)

Source from the content-addressed store, hash-verified

107
108@contextlib.contextmanager
109def frozen_modules(enabled=True):
110 """Force frozen modules to be used (or not).
111
112 This only applies to modules that haven't been imported yet.
113 Also, some essential modules will always be imported frozen.
114 """
115 _imp._override_frozen_modules_for_tests(1 if enabled else -1)
116 try:
117 yield
118 finally:
119 _imp._override_frozen_modules_for_tests(0)
120
121
122@contextlib.contextmanager

Callers 2

import_fresh_moduleFunction · 0.85
__init__Method · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…