Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 02d03df

Browse files
committed
Issue #26823: fix traceback abbreviation docs
- be clear builtin traceback display was also updated - show example output in What's New - fix versionadded markup
1 parent b09b3f7 commit 02d03df

2 files changed

Lines changed: 25 additions & 6 deletions

File tree

Doc/library/traceback.rst

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -302,9 +302,8 @@ capture data for later printing in a lightweight fashion.
302302
repetitions are shown, followed by a summary line stating the exact
303303
number of further repetitions.
304304

305-
.. versionchanged:: 3.6
306-
307-
Long sequences of repeated frames are now abbreviated.
305+
.. versionchanged:: 3.6
306+
Long sequences of repeated frames are now abbreviated.
308307

309308

310309
:class:`FrameSummary` Objects

Doc/whatsnew/3.6.rst

Lines changed: 23 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,12 @@ Example of fatal error on buffer overflow using
207207
Other Language Changes
208208
======================
209209

210-
* None yet.
210+
Some smaller changes made to the core Python language are:
211+
212+
* Long sequences of repeated traceback lines are now abbreviated as
213+
``"[Previous line repeated {count} more times]"`` (see
214+
:ref:`py36-traceback` for an example).
215+
(Contributed by Emanuel Barry in :issue:`26823`.)
211216

212217

213218
New Modules
@@ -438,11 +443,26 @@ not work in future versions of Tcl.
438443
(Contributed by Serhiy Storchaka in :issue:`22115`).
439444

440445

446+
.. _py36-traceback:
447+
441448
traceback
442449
---------
443450

444-
The :meth:`~traceback.StackSummary.format` method now abbreviates long sequences
445-
of repeated lines as ``"[Previous line repeated {count} more times]"``.
451+
Both the traceback module and the interpreter's builtin exception display now
452+
abbreviate long sequences of repeated lines in tracebacks as shown in the
453+
following example::
454+
455+
>>> def f(): f()
456+
...
457+
>>> f()
458+
Traceback (most recent call last):
459+
File "<stdin>", line 1, in <module>
460+
File "<stdin>", line 1, in f
461+
File "<stdin>", line 1, in f
462+
File "<stdin>", line 1, in f
463+
[Previous line repeated 995 more times]
464+
RecursionError: maximum recursion depth exceeded
465+
446466
(Contributed by Emanuel Barry in :issue:`26823`.)
447467

448468

0 commit comments

Comments
 (0)