Skip to content

Commit

Permalink
[3.10] gh-89412: Add missing attributes (added in 3.10) to traceback …
Browse files Browse the repository at this point in the history
…module docs (GH-105046) (#105329)

(cherry picked from commit a4f72fa)

Co-authored-by: Jakub Kuczys <me@jacken.men>
  • Loading branch information
miss-islington and Jackenmen authored Jun 5, 2023
1 parent cb37100 commit b7fd286
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 2 deletions.
14 changes: 14 additions & 0 deletions Doc/library/traceback.rst
Original file line number Diff line number Diff line change
Expand Up @@ -259,6 +259,13 @@ capture data for later printing in a lightweight fashion.

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

.. attribute:: end_lineno

For syntax errors - the end line number where the error occurred.
Can be ``None`` if not present.

.. versionadded:: 3.10

.. attribute:: text

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

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

.. attribute:: end_offset

For syntax errors - the end offset into the text where the error occurred.
Can be ``None`` if not present.

.. versionadded:: 3.10

.. attribute:: msg

For syntax errors - the compiler error message.
Expand Down
4 changes: 2 additions & 2 deletions Lib/traceback.py
Original file line number Diff line number Diff line change
Expand Up @@ -481,8 +481,8 @@ class TracebackException:
occurred.
- :attr:`offset` For syntax errors - the offset into the text where the
error occurred.
- :attr:`end_offset` For syntax errors - the offset into the text where the
error occurred. Can be `None` if not present.
- :attr:`end_offset` For syntax errors - the end offset into the text where
the error occurred. Can be `None` if not present.
- :attr:`msg` For syntax errors - the compiler error message.
"""

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Add missing documentation for the ``end_lineno`` and ``end_offset`` attributes
of the :class:`traceback.TracebackException` class.

0 comments on commit b7fd286

Please sign in to comment.