MCPcopy Index your code
hub / github.com/ipython/ipython / _showtraceback

Method _showtraceback

IPython/core/interactiveshell.py:2246–2258  ·  view source on GitHub ↗

Actually show a traceback. Subclasses may override this method to put the traceback on a different place, like a side channel.

(self, etype, evalue, stb: list[str])

Source from the content-addressed store, hash-verified

2244 print('\n' + self.get_exception_only(), file=sys.stderr)
2245
2246 def _showtraceback(self, etype, evalue, stb: list[str]):
2247 """Actually show a traceback.
2248
2249 Subclasses may override this method to put the traceback on a different
2250 place, like a side channel.
2251 """
2252 val = self.InteractiveTB.stb2text(stb)
2253 self.showing_traceback = True
2254 try:
2255 print(val)
2256 except UnicodeEncodeError:
2257 print(val.encode("utf-8", "backslashreplace").decode())
2258 self.showing_traceback = False
2259
2260 def showsyntaxerror(self, filename=None, running_compiled_code=False):
2261 """Display the syntax error that just occurred.

Callers 3

showtracebackMethod · 0.95
showsyntaxerrorMethod · 0.95

Calls 1

stb2textMethod · 0.45

Tested by 1