Skip to content

Commit 0576ebe

Browse files
committed
Fix typos and stale docstrings in Lib/traceback.py.
1 parent 08a018e commit 0576ebe

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

Lib/traceback.py

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -83,10 +83,11 @@ def extract_tb(tb, limit=None):
8383
This is useful for alternate formatting of stack traces. If
8484
'limit' is omitted or None, all entries are extracted. A
8585
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.
86+
containing attributes filename, lineno, name, line, end_lineno,
87+
colno, and end_colno representing the information that is
88+
usually printed for a stack trace. The line is a string with
89+
leading and trailing whitespace stripped; if the source is not
90+
available it is None.
9091
"""
9192
return StackSummary._extract_from_extended_frame_gen(
9293
_walk_tb_with_full_positions(tb), limit=limit)
@@ -263,9 +264,8 @@ def extract_stack(f=None, limit=None):
263264
264265
The return value has the same format as for extract_tb(). The
265266
optional 'f' and 'limit' arguments have the same meaning as for
266-
print_stack(). Each item in the list is a quadruple (filename,
267-
line number, function name, text), and the entries are in order
268-
from oldest to newest stack frame.
267+
print_stack(). Each item in the list is a FrameSummary object,
268+
and the entries are in order from oldest to newest stack frame.
269269
"""
270270
if f is None:
271271
f = sys._getframe().f_back
@@ -294,7 +294,7 @@ class FrameSummary:
294294
- :attr:`name` The name of the function or method that was executing
295295
when the frame was captured.
296296
- :attr:`line` The text from the linecache module for the
297-
of code that was running when the frame was captured.
297+
code that was running when the frame was captured.
298298
- :attr:`locals` Either None if locals were not supplied, or a dict
299299
mapping the name to the repr() of the variable.
300300
- :attr:`end_lineno` The last line number of the source code for this frame.
@@ -974,9 +974,9 @@ def setup_positions(expr, force_valid=True):
974974
_WIDE_CHAR_SPECIFIERS = "WF"
975975

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

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

0 commit comments

Comments
 (0)