Skip to content

Commit ab660e9

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

File tree

3 files changed

+18
-2
lines changed

3 files changed

+18
-2
lines changed

Doc/library/traceback.rst

+14
Original file line numberDiff line numberDiff line change
@@ -279,6 +279,13 @@ capture data for later printing in a lightweight fashion.
279279

280280
For syntax errors - the line number where the error occurred.
281281

282+
.. attribute:: end_lineno
283+
284+
For syntax errors - the end line number where the error occurred.
285+
Can be ``None`` if not present.
286+
287+
.. versionadded:: 3.10
288+
282289
.. attribute:: text
283290

284291
For syntax errors - the text where the error occurred.
@@ -287,6 +294,13 @@ capture data for later printing in a lightweight fashion.
287294

288295
For syntax errors - the offset into the text where the error occurred.
289296

297+
.. attribute:: end_offset
298+
299+
For syntax errors - the end offset into the text where the error occurred.
300+
Can be ``None`` if not present.
301+
302+
.. versionadded:: 3.10
303+
290304
.. attribute:: msg
291305

292306
For syntax errors - the compiler error message.

Lib/traceback.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -674,8 +674,8 @@ class TracebackException:
674674
occurred.
675675
- :attr:`offset` For syntax errors - the offset into the text where the
676676
error occurred.
677-
- :attr:`end_offset` For syntax errors - the offset into the text where the
678-
error occurred. Can be `None` if not present.
677+
- :attr:`end_offset` For syntax errors - the end offset into the text where
678+
the error occurred. Can be `None` if not present.
679679
- :attr:`msg` For syntax errors - the compiler error message.
680680
"""
681681

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)