Skip to content

Commit

Permalink
Attempt at debugging #13598
Browse files Browse the repository at this point in the history
  • Loading branch information
Carreau committed Mar 26, 2022
1 parent 47ccec7 commit ad57192
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions IPython/core/interactiveshell.py
Expand Up @@ -1976,10 +1976,19 @@ def showtraceback(self, exc_tuple=None, filename=None, tb_offset=None,
# Exception classes can customise their traceback - we
# use this in IPython.parallel for exceptions occurring
# in the engines. This should return a list of strings.
stb = value._render_traceback_()
if hasattr(value, "_render_traceback_"):
stb = value._render_traceback_()
else:
stb = self.InteractiveTB.structured_traceback(
etype, value, tb, tb_offset=tb_offset
)

except Exception:
stb = self.InteractiveTB.structured_traceback(etype,
value, tb, tb_offset=tb_offset)
print(
"Unexpected exception formatting exception. Falling back to standard exception"
)
traceback.print_exc()
return None

self._showtraceback(etype, value, stb)
if self.call_pdb:
Expand Down

0 comments on commit ad57192

Please sign in to comment.