MCPcopy Index your code
hub / github.com/python/cpython / compact_traceback

Function compact_traceback

Lib/test/support/asyncore.py:539–558  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

537# ---------------------------------------------------------------------------
538
539def compact_traceback():
540 exc = sys.exception()
541 tb = exc.__traceback__
542 if not tb: # Must have a traceback
543 raise AssertionError("traceback does not exist")
544 tbinfo = []
545 while tb:
546 tbinfo.append((
547 tb.tb_frame.f_code.co_filename,
548 tb.tb_frame.f_code.co_name,
549 str(tb.tb_lineno)
550 ))
551 tb = tb.tb_next
552
553 # just to be safe
554 del tb
555
556 file, function, line = tbinfo[-1]
557 info = ' '.join(['[%s|%s|%s]' % x for x in tbinfo])
558 return (file, function, line), type(exc), exc, info
559
560def close_all(map=None, ignore_all=False):
561 if map is None:

Callers 1

handle_errorMethod · 0.85

Calls 4

strFunction · 0.85
exceptionMethod · 0.45
appendMethod · 0.45
joinMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…