Skip to content

Commit

Permalink
Ignore more exceptions in stubtest (#11946)
Browse files Browse the repository at this point in the history
  • Loading branch information
JelleZijlstra committed Jan 12, 2022
1 parent 0bc040e commit fa16759
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions mypy/stubtest.py
Original file line number Diff line number Diff line change
Expand Up @@ -269,11 +269,14 @@ def verify_typeinfo(
mangled_entry = "_{}{}".format(stub.name, entry)
stub_to_verify = next((t.names[entry].node for t in stub.mro if entry in t.names), MISSING)
assert stub_to_verify is not None
yield from verify(
stub_to_verify,
getattr(runtime, mangled_entry, MISSING),
object_path + [entry],
)
try:
runtime_attr = getattr(runtime, mangled_entry, MISSING)
except Exception:
# Catch all exceptions in case the runtime raises an unexpected exception
# from __getattr__ or similar.
pass
else:
yield from verify(stub_to_verify, runtime_attr, object_path + [entry])


def _verify_static_class_methods(
Expand Down

0 comments on commit fa16759

Please sign in to comment.