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

Function extract_tb

Lib/traceback.py:78–92  ·  view source on GitHub ↗

Return a StackSummary object representing a list of pre-processed entries from traceback. This is useful for alternate formatting of stack traces. If 'limit' is omitted or None, all entries are extracted. A pre-processed stack trace entry is a FrameSummary object containi

(tb, limit=None)

Source from the content-addressed store, hash-verified

76 return extract_tb(tb, limit=limit).format()
77
78def extract_tb(tb, limit=None):
79 """
80 Return a StackSummary object representing a list of
81 pre-processed entries from traceback.
82
83 This is useful for alternate formatting of stack traces. If
84 'limit' is omitted or None, all entries are extracted. A
85 pre-processed stack trace entry is a FrameSummary object
86 containing attributes filename, lineno, name, and line
87 representing the information that is usually printed for a stack
88 trace. The line is a string with leading and trailing
89 whitespace stripped; if the source is not available it is None.
90 """
91 return StackSummary._extract_from_extended_frame_gen(
92 _walk_tb_with_full_positions(tb), limit=limit)
93
94#
95# Exception formatting and output.

Callers 3

doTracebackMethod · 0.90
print_tbFunction · 0.85
format_tbFunction · 0.85

Tested by 1

doTracebackMethod · 0.72

Used in the wild real call sites across dependent graphs

searching dependent graphs…