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

Method structured_traceback

IPython/core/ultratb.py:1330–1347  ·  view source on GitHub ↗
(self, etype, value, tb, tb_offset=None, number_of_lines_of_context=5)

Source from the content-addressed store, hash-verified

1328 self.set_mode(mode)
1329
1330 def structured_traceback(self, etype, value, tb, tb_offset=None, number_of_lines_of_context=5):
1331 tb_offset = self.tb_offset if tb_offset is None else tb_offset
1332 mode = self.mode
1333 if mode in self.verbose_modes:
1334 # Verbose modes need a full traceback
1335 return VerboseTB.structured_traceback(
1336 self, etype, value, tb, tb_offset, number_of_lines_of_context
1337 )
1338 elif mode == 'Minimal':
1339 return ListTB.get_exception_only(self, etype, value)
1340 else:
1341 # We must check the source cache because otherwise we can print
1342 # out-of-date source code.
1343 self.check_cache()
1344 # Now we can extract and format the exception
1345 return ListTB.structured_traceback(
1346 self, etype, value, tb, tb_offset, number_of_lines_of_context
1347 )
1348
1349 def stb2text(self, stb):
1350 """Convert a structured traceback (a list) to a string."""

Callers

nothing calls this directly

Calls 2

structured_tracebackMethod · 0.45
get_exception_onlyMethod · 0.45

Tested by

no test coverage detected