Kaydet (Commit) 02d03dfa authored tarafından Nick Coghlan's avatar Nick Coghlan

Issue #26823: fix traceback abbreviation docs

- be clear builtin traceback display was also updated
- show example output in What's New
- fix versionadded markup
üst b09b3f7a
...@@ -303,7 +303,6 @@ capture data for later printing in a lightweight fashion. ...@@ -303,7 +303,6 @@ capture data for later printing in a lightweight fashion.
number of further repetitions. number of further repetitions.
.. versionchanged:: 3.6 .. versionchanged:: 3.6
Long sequences of repeated frames are now abbreviated. Long sequences of repeated frames are now abbreviated.
......
...@@ -207,7 +207,12 @@ Example of fatal error on buffer overflow using ...@@ -207,7 +207,12 @@ Example of fatal error on buffer overflow using
Other Language Changes Other Language Changes
====================== ======================
* None yet. Some smaller changes made to the core Python language are:
* Long sequences of repeated traceback lines are now abbreviated as
``"[Previous line repeated {count} more times]"`` (see
:ref:`py36-traceback` for an example).
(Contributed by Emanuel Barry in :issue:`26823`.)
New Modules New Modules
...@@ -438,11 +443,26 @@ not work in future versions of Tcl. ...@@ -438,11 +443,26 @@ not work in future versions of Tcl.
(Contributed by Serhiy Storchaka in :issue:`22115`). (Contributed by Serhiy Storchaka in :issue:`22115`).
.. _py36-traceback:
traceback traceback
--------- ---------
The :meth:`~traceback.StackSummary.format` method now abbreviates long sequences Both the traceback module and the interpreter's builtin exception display now
of repeated lines as ``"[Previous line repeated {count} more times]"``. abbreviate long sequences of repeated lines in tracebacks as shown in the
following example::
>>> def f(): f()
...
>>> f()
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "<stdin>", line 1, in f
File "<stdin>", line 1, in f
File "<stdin>", line 1, in f
[Previous line repeated 995 more times]
RecursionError: maximum recursion depth exceeded
(Contributed by Emanuel Barry in :issue:`26823`.) (Contributed by Emanuel Barry in :issue:`26823`.)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment