Lines Matching refs:tb
47 def print_tb(tb, limit=None, file=None):
48 """Print up to 'limit' stack trace entries from the traceback 'tb'.
55 print_list(extract_tb(tb, limit=limit), file=file)
57 def format_tb(tb, limit=None):
58 """A shorthand for 'format_list(extract_tb(tb, limit))'."""
59 return extract_tb(tb, limit=limit).format()
61 def extract_tb(tb, limit=None):
75 _walk_tb_with_full_positions(tb), limit=limit)
96 def _parse_value_tb(exc, value, tb):
97 if (value is _sentinel) != (tb is _sentinel):
98 raise ValueError("Both or neither of value and tb must be given")
99 if value is tb is _sentinel:
108 return value, tb
111 def print_exception(exc, /, value=_sentinel, tb=_sentinel, limit=None, \
113 """Print exception up to 'limit' stack trace entries from 'tb' to 'file'.
123 value, tb = _parse_value_tb(exc, value, tb)
124 te = TracebackException(type(value), value, tb, limit=limit, compact=True)
128 def format_exception(exc, /, value=_sentinel, tb=_sentinel, limit=None, \
138 value, tb = _parse_value_tb(exc, value, tb)
139 te = TracebackException(type(value), value, tb, limit=limit, compact=True)
236 def clear_frames(tb):
238 while tb is not None:
240 tb.tb_frame.clear()
244 tb = tb.tb_next
338 def walk_tb(tb):
341 This will follow tb.tb_next (and thus is in the opposite order to
344 while tb is not None:
345 yield tb.tb_frame, tb.tb_lineno
346 tb = tb.tb_next
349 def _walk_tb_with_full_positions(tb):
352 while tb is not None:
353 positions = _get_code_position(tb.tb_frame.f_code, tb.tb_lasti)
357 yield tb.tb_frame, (tb.tb_lineno, ) + positions[1:]
359 yield tb.tb_frame, positions
360 tb = tb.tb_next