Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Handle case inspect fails on repl-defined objects
  • Loading branch information
darrenburns committed Mar 8, 2022
commit b67fd39eb586430a6f80de2ef2ac1960fe29ba51
3 changes: 2 additions & 1 deletion rich/_inspect.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,8 @@ def _get_signature(self, name: str, obj: Any) -> Optional[Text]:
source_filename: Optional[str] = None
try:
source_filename = getfile(obj)
except TypeError:
except (OSError, TypeError):
# OSError is raised if obj has no source file, e.g. when defined in REPL.
pass

callable_name = Text(name, style="inspect.callable")
Expand Down