Skip to content

Commit

Permalink
Catch TypeError together with OSError when inspect source (#115)
Browse files Browse the repository at this point in the history
  • Loading branch information
gaogaotiantian authored Nov 9, 2024
1 parent a950dba commit 10b3592
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/objprint/frame_analyzer.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ def get_executing_function_call_str(self, frame: FrameType) -> Optional[str]:
if module is None:
return None
source = inspect.getsource(module)
except OSError:
except (OSError, TypeError):
return None

return ast.get_source_segment(source, node)
Expand Down

0 comments on commit 10b3592

Please sign in to comment.