Skip to content

Commit

Permalink
stubtest: catch SyntaxError from inspect.getsourcelines (#13848)
Browse files Browse the repository at this point in the history
Fixes #13822
  • Loading branch information
hauntsaninja authored Oct 9, 2022
1 parent 366b7e1 commit 1fbbe91
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion mypy/stubtest.py
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ def get_description(self, concise: bool = False) -> str:
if not isinstance(self.runtime_object, Missing):
try:
runtime_line = inspect.getsourcelines(self.runtime_object)[1]
except (OSError, TypeError):
except (OSError, TypeError, SyntaxError):
pass
try:
runtime_file = inspect.getsourcefile(self.runtime_object)
Expand Down

0 comments on commit 1fbbe91

Please sign in to comment.