Skip to content

Commit b7fd286

Browse files
[3.10] gh-89412: Add missing attributes (added in 3.10) to traceback module docs (GH-105046) (#105329)
(cherry picked from commit a4f72fa) Co-authored-by: Jakub Kuczys <[email protected]>
1 parent cb37100 commit b7fd286

File tree

3 files changed

+18
-2
lines changed

3 files changed

+18
-2
lines changed

Doc/library/traceback.rst

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -259,6 +259,13 @@ capture data for later printing in a lightweight fashion.
259259

260260
For syntax errors - the line number where the error occurred.
261261

262+
.. attribute:: end_lineno
263+
264+
For syntax errors - the end line number where the error occurred.
265+
Can be ``None`` if not present.
266+
267+
.. versionadded:: 3.10
268+
262269
.. attribute:: text
263270

264271
For syntax errors - the text where the error occurred.
@@ -267,6 +274,13 @@ capture data for later printing in a lightweight fashion.
267274

268275
For syntax errors - the offset into the text where the error occurred.
269276

277+
.. attribute:: end_offset
278+
279+
For syntax errors - the end offset into the text where the error occurred.
280+
Can be ``None`` if not present.
281+
282+
.. versionadded:: 3.10
283+
270284
.. attribute:: msg
271285

272286
For syntax errors - the compiler error message.

Lib/traceback.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -481,8 +481,8 @@ class TracebackException:
481481
occurred.
482482
- :attr:`offset` For syntax errors - the offset into the text where the
483483
error occurred.
484-
- :attr:`end_offset` For syntax errors - the offset into the text where the
485-
error occurred. Can be `None` if not present.
484+
- :attr:`end_offset` For syntax errors - the end offset into the text where
485+
the error occurred. Can be `None` if not present.
486486
- :attr:`msg` For syntax errors - the compiler error message.
487487
"""
488488

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
Add missing documentation for the ``end_lineno`` and ``end_offset`` attributes
2+
of the :class:`traceback.TracebackException` class.

0 commit comments

Comments
 (0)