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

Function print_tb

Lib/traceback.py:64–72  ·  view source on GitHub ↗

Print up to 'limit' stack trace entries from the traceback 'tb'. If 'limit' is omitted or None, all entries are printed. If 'file' is omitted or None, the output goes to sys.stderr; otherwise 'file' should be an open file or file-like object with a write() method.

(tb, limit=None, file=None)

Source from the content-addressed store, hash-verified

62#
63
64def print_tb(tb, limit=None, file=None):
65 """Print up to 'limit' stack trace entries from the traceback 'tb'.
66
67 If 'limit' is omitted or None, all entries are printed. If 'file'
68 is omitted or None, the output goes to sys.stderr; otherwise
69 'file' should be an open file or file-like object with a write()
70 method.
71 """
72 print_list(extract_tb(tb, limit=limit), file=file)
73
74def format_tb(tb, limit=None):
75 """A shorthand for 'format_list(extract_tb(tb, limit))'."""

Callers 1

doTracebackMethod · 0.90

Calls 2

print_listFunction · 0.85
extract_tbFunction · 0.85

Tested by 1

doTracebackMethod · 0.72

Used in the wild real call sites across dependent graphs

searching dependent graphs…