Skip to content

Commit 58e596a

Browse files
author
hauntsaninja
committed
stubtest: remove unnecessary code
I can no longer repro any of the behaviour related to distutils.command. I found one case it can come up involving builtins, but overall I think this code is just simpler like this.
1 parent d0f10e7 commit 58e596a

File tree

1 file changed

+0
-9
lines changed

1 file changed

+0
-9
lines changed

mypy/stubtest.py

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -662,15 +662,6 @@ def verify_funcitem(
662662
def verify_none(
663663
stub: Missing, runtime: MaybeMissing[Any], object_path: List[str]
664664
) -> Iterator[Error]:
665-
if isinstance(runtime, Missing):
666-
try:
667-
# We shouldn't really get here since that would involve something not existing both in
668-
# the stub and the runtime, however, some modules like distutils.command have some
669-
# weird things going on. Try to see if we can find a runtime object by importing it,
670-
# otherwise crash.
671-
runtime = importlib.import_module(".".join(object_path))
672-
except ImportError:
673-
raise RuntimeError
674665
yield Error(object_path, "is not present in stub", stub, runtime)
675666

676667

0 commit comments

Comments
 (0)