Skip to content

Commit c90fccd

Browse files
committed
Issue #27208: Fix doctest in Doc/library/traceback.rst
Patch by Jelle Zijlstra.
1 parent 4032620 commit c90fccd

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

Doc/library/traceback.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -361,7 +361,7 @@ exception and traceback:
361361
traceback.print_exception(exc_type, exc_value, exc_traceback,
362362
limit=2, file=sys.stdout)
363363
print("*** print_exc:")
364-
traceback.print_exc()
364+
traceback.print_exc(limit=2, file=sys.stdout)
365365
print("*** format_exc, first and last line:")
366366
formatted_lines = traceback.format_exc().splitlines()
367367
print(formatted_lines[0])
@@ -407,9 +407,9 @@ The output for the example would look similar to this:
407407
' File "<doctest...>", line 7, in bright_side_of_death\n return tuple()[0]\n',
408408
'IndexError: tuple index out of range\n']
409409
*** extract_tb:
410-
[('<doctest...>', 10, '<module>', 'lumberjack()'),
411-
('<doctest...>', 4, 'lumberjack', 'bright_side_of_death()'),
412-
('<doctest...>', 7, 'bright_side_of_death', 'return tuple()[0]')]
410+
[<FrameSummary file <doctest...>, line 10 in <module>>,
411+
<FrameSummary file <doctest...>, line 4 in lumberjack>,
412+
<FrameSummary file <doctest...>, line 7 in bright_side_of_death>]
413413
*** format_tb:
414414
[' File "<doctest...>", line 10, in <module>\n lumberjack()\n',
415415
' File "<doctest...>", line 4, in lumberjack\n bright_side_of_death()\n',

0 commit comments

Comments
 (0)