Skip to content

Commit

Permalink
Small fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
ale-rt committed Nov 29, 2024
1 parent c66a68d commit f50a547
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/collective/pdbpp/__init__.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"""Init and utils."""

from AccessControl import Unauthorized
from pdb import Pdb # type: ignore
from pdb import Pdb # type: ignore
from plone import api
from Products.Five import BrowserView
from rich import inspect
Expand All @@ -23,10 +23,12 @@ def _do_pp(self, arg):
obj = self._getval(arg)
# Use rich's pprint to display the object
pretty.pprint(obj, expand_all=True)
except Exception as e:
print(f"[red]Error:[/red] {e}") # noqa E231
except Exception:
self._original_do_pp(arg)



Pdb._original_do_pp = Pdb.do_pp
Pdb.do_pp = _do_pp


Expand Down

0 comments on commit f50a547

Please sign in to comment.