MCPcopy
hub / github.com/msgspec/msgspec / package_not_installed

Function package_not_installed

tests/unit/utils.py:51–60  ·  view source on GitHub ↗
(name)

Source from the content-addressed store, hash-verified

49
50@contextmanager
51def package_not_installed(name):
52 try:
53 orig = sys.modules.get(name)
54 sys.modules[name] = None
55 yield
56 finally:
57 if orig is not None:
58 sys.modules[name] = orig
59 else:
60 del sys.modules[name]

Callers 1

Calls 1

getMethod · 0.80

Tested by 1

Used in the wild real call sites across dependent graphs

searching dependent graphs…