Skip to content

Commit 43f547e

Browse files
committed
Add an ii command
1 parent 7c3f989 commit 43f547e

1 file changed

Lines changed: 8 additions & 11 deletions

File tree

src/collective/pdbpp/__init__.py

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -50,22 +50,19 @@ def _do_pp(self, arg):
5050
self._original_do_pp(arg)
5151

5252

53-
def _do_inspect(self, arg):
54-
"""Override the inspect command to use rich."""
55-
try:
56-
# Evaluate the argument in the current debugging context
57-
obj = self._getval(arg)
58-
# Use rich's inspect to display the object
59-
rich.inspect(obj)
60-
except Exception:
61-
self._original_do_inspect(arg)
53+
def _do_ii(self: Pdb, arg):
54+
"""Provide a rich inspect command."""
55+
# Evaluate the argument in the current debugging context
56+
obj = self._getval(arg)
57+
# Use rich's inspect to display the object
58+
rich.inspect(obj)
6259

6360

6461
Pdb._original_do_pp = Pdb.do_pp
6562
Pdb.do_pp = _do_pp
6663

67-
Pdb._original_do_inspect = Pdb.do_inspect
68-
Pdb.do_inspect = _do_pp
64+
Pdb.do_ii = _do_ii
65+
6966
DefaultConfig.sticky_by_default = True
7067

7168

0 commit comments

Comments
 (0)