Skip to content

Commit

Permalink
stubtest: remove unnecessary code
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
hauntsaninja committed May 25, 2020
1 parent ca7679f commit aa48c4b
Showing 1 changed file with 0 additions and 9 deletions.
9 changes: 0 additions & 9 deletions mypy/stubtest.py
Original file line number Diff line number Diff line change
Expand Up @@ -662,15 +662,6 @@ def verify_funcitem(
def verify_none(
stub: Missing, runtime: MaybeMissing[Any], object_path: List[str]
) -> Iterator[Error]:
if isinstance(runtime, Missing):
try:
# We shouldn't really get here since that would involve something not existing both in
# the stub and the runtime, however, some modules like distutils.command have some
# weird things going on. Try to see if we can find a runtime object by importing it,
# otherwise crash.
runtime = importlib.import_module(".".join(object_path))
except ImportError:
raise RuntimeError
yield Error(object_path, "is not present in stub", stub, runtime)


Expand Down

0 comments on commit aa48c4b

Please sign in to comment.