MCPcopy Index your code
hub / github.com/python/mypy / fail_missing

Function fail_missing

mypy/stubutil.py:166–173  ·  view source on GitHub ↗
(mod: str, reason: ModuleNotFoundReason)

Source from the content-addressed store, hash-verified

164
165
166def fail_missing(mod: str, reason: ModuleNotFoundReason) -> None:
167 if reason is ModuleNotFoundReason.NOT_FOUND:
168 clarification = "(consider using --search-path)"
169 elif reason is ModuleNotFoundReason.FOUND_WITHOUT_TYPE_HINTS:
170 clarification = "(module likely exists, but is not PEP 561 compatible)"
171 else:
172 clarification = f"(unknown reason '{reason}')"
173 raise SystemExit(f"Can't find module '{mod}' {clarification}")
174
175
176@overload

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…