MCPcopy Index your code
hub / github.com/ipython/ipython / module_not_installed

Function module_not_installed

tests/test_guarded_eval.py:56–67  ·  view source on GitHub ↗
(module: str)

Source from the content-addressed store, hash-verified

54
55@contextmanager
56def module_not_installed(module: str):
57 import sys
58
59 try:
60 to_restore = sys.modules[module]
61 del sys.modules[module]
62 except KeyError:
63 to_restore = None
64 try:
65 yield
66 finally:
67 sys.modules[module] = to_restore
68
69
70def test_external_not_installed():

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…