Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 12 additions & 12 deletions Lib/traceback.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,10 +83,11 @@ def extract_tb(tb, limit=None):
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
containing attributes filename, lineno, name, and line
representing the information that is usually printed for a stack
trace. The line is a string with leading and trailing
whitespace stripped; if the source is not available it is None.
containing attributes filename, lineno, name, line, end_lineno,
colno, and end_colno representing the information that is
usually printed for a stack trace. The line is a string with
leading and trailing whitespace stripped; if the source is not
available it is None.
"""
return StackSummary._extract_from_extended_frame_gen(
_walk_tb_with_full_positions(tb), limit=limit)
Expand Down Expand Up @@ -263,9 +264,8 @@ def extract_stack(f=None, limit=None):

The return value has the same format as for extract_tb(). The
optional 'f' and 'limit' arguments have the same meaning as for
print_stack(). Each item in the list is a quadruple (filename,
line number, function name, text), and the entries are in order
from oldest to newest stack frame.
print_stack(). Each item in the list is a FrameSummary object,
and the entries are in order from oldest to newest stack frame.
"""
if f is None:
f = sys._getframe().f_back
Expand Down Expand Up @@ -294,7 +294,7 @@ class FrameSummary:
- :attr:`name` The name of the function or method that was executing
when the frame was captured.
- :attr:`line` The text from the linecache module for the
of code that was running when the frame was captured.
code that was running when the frame was captured.
- :attr:`locals` Either None if locals were not supplied, or a dict
mapping the name to the repr() of the variable.
- :attr:`end_lineno` The last line number of the source code for this frame.
Expand Down Expand Up @@ -974,9 +974,9 @@ def setup_positions(expr, force_valid=True):
_WIDE_CHAR_SPECIFIERS = "WF"

def _display_width(line, offset=None):
"""Calculate the extra amount of width space the given source
code segment might take if it were to be displayed on a fixed
width output device. Supports wide unicode characters and emojis."""
"""Calculate the amount of width space the given source code
segment might take if it were to be displayed on a fixed width
output device. Supports wide unicode characters and emojis."""

if offset is None:
offset = len(line)
Expand Down Expand Up @@ -1060,7 +1060,7 @@ class TracebackException:
def __init__(self, exc_type, exc_value, exc_traceback, *, limit=None,
lookup_lines=True, capture_locals=False, compact=False,
max_group_width=15, max_group_depth=10, save_exc_type=True, _seen=None):
# NB: we need to accept exc_traceback, exc_value, exc_traceback to
# NB: we need to accept exc_type, exc_value, exc_traceback to
# permit backwards compat with the existing API, otherwise we
# need stub thunk objects just to glue it together.
# Handle loops in __cause__ or __context__.
Expand Down
Loading