MCPcopy Create free account
hub / github.com/ipython/ipython / _exception_pprint

Function _exception_pprint

IPython/lib/pretty.py:722–734  ·  view source on GitHub ↗

Base pprint for all exceptions.

(obj, p, cycle)

Source from the content-addressed store, hash-verified

720
721
722def _exception_pprint(obj, p, cycle):
723 """Base pprint for all exceptions."""
724 name = getattr(obj.__class__, '__qualname__', obj.__class__.__name__)
725 if obj.__class__.__module__ not in ('exceptions', 'builtins'):
726 name = '%s.%s' % (obj.__class__.__module__, name)
727 step = len(name) + 1
728 p.begin_group(step, name + '(')
729 for idx, arg in enumerate(getattr(obj, 'args', ())):
730 if idx:
731 p.text(',')
732 p.breakable()
733 p.pretty(arg)
734 p.end_group(step, ')')
735
736
737#: the exception base

Callers

nothing calls this directly

Calls 5

begin_groupMethod · 0.80
breakableMethod · 0.80
prettyMethod · 0.80
end_groupMethod · 0.80
textMethod · 0.45

Tested by

no test coverage detected