diff options
author | Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com> | 2023-06-05 17:02:23 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-06-05 17:02:23 (GMT) |
commit | faae548e0e22585e2f8ac5f92f9587c837f1db97 (patch) | |
tree | a542cbb85aef90828f17e2064413ce5f42be1a3d | |
parent | 93d9e990fbc14e3bf2b8f050033e25bdb4cb818c (diff) | |
download | cpython-faae548e0e22585e2f8ac5f92f9587c837f1db97.zip cpython-faae548e0e22585e2f8ac5f92f9587c837f1db97.tar.gz cpython-faae548e0e22585e2f8ac5f92f9587c837f1db97.tar.bz2 |
[3.11] gh-89412: Add missing attributes (added in 3.10) to traceback module docs (GH-105046) (#105328)
(cherry picked from commit a4f72fa39a9d391c7b931ba1906d81da4ae01949)
Co-authored-by: Jakub Kuczys <me@jacken.men>
-rw-r--r-- | Doc/library/traceback.rst | 14 | ||||
-rw-r--r-- | Lib/traceback.py | 4 | ||||
-rw-r--r-- | Misc/NEWS.d/next/Documentation/2023-05-28-19-08-42.gh-issue-89412.j4cg7K.rst | 2 |
3 files changed, 18 insertions, 2 deletions
diff --git a/Doc/library/traceback.rst b/Doc/library/traceback.rst index 9924dde..100e3e6 100644 --- a/Doc/library/traceback.rst +++ b/Doc/library/traceback.rst @@ -280,6 +280,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. @@ -288,6 +295,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. diff --git a/Lib/traceback.py b/Lib/traceback.py index 9afff23..09950a8b 100644 --- a/Lib/traceback.py +++ b/Lib/traceback.py @@ -669,8 +669,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. """ diff --git a/Misc/NEWS.d/next/Documentation/2023-05-28-19-08-42.gh-issue-89412.j4cg7K.rst b/Misc/NEWS.d/next/Documentation/2023-05-28-19-08-42.gh-issue-89412.j4cg7K.rst new file mode 100644 index 0000000..00937e5 --- /dev/null +++ b/Misc/NEWS.d/next/Documentation/2023-05-28-19-08-42.gh-issue-89412.j4cg7K.rst @@ -0,0 +1,2 @@ +Add missing documentation for the ``end_lineno`` and ``end_offset`` attributes +of the :class:`traceback.TracebackException` class. |