Skip to content

Commit

Permalink
traceback to json
Browse files Browse the repository at this point in the history
  • Loading branch information
Quentin Peter committed May 25, 2024
1 parent 4f41ea9 commit e04ff79
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions spyder_kernels/console/shell.py
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,18 @@ def showtraceback(self, exc_tuple=None, filename=None, tb_offset=None,
if not exception_only:
try:
etype, value, tb = self._get_exc_info(exc_tuple)
etype = etype.__name__
value = value.args
stack = traceback.extract_tb(tb.tb_next)
stack = [
{
"filename": frame.filename,
"lineno": frame.lineno,
"name": frame.name,
"line": frame.line
}
for frame in stack
]
self.kernel.frontend_call(blocking=False).show_traceback(
etype, value, stack)
except Exception:
Expand Down

0 comments on commit e04ff79

Please sign in to comment.