]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
[3.10] gh-89412: Add missing attributes (added in 3.10) to traceback module docs...
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Mon, 5 Jun 2023 17:02:31 +0000 (10:02 -0700)
committerGitHub <noreply@github.com>
Mon, 5 Jun 2023 17:02:31 +0000 (19:02 +0200)
(cherry picked from commit a4f72fa39a9d391c7b931ba1906d81da4ae01949)

Co-authored-by: Jakub Kuczys <me@jacken.men>
Doc/library/traceback.rst
Lib/traceback.py
Misc/NEWS.d/next/Documentation/2023-05-28-19-08-42.gh-issue-89412.j4cg7K.rst [new file with mode: 0644]

index ab51cb9bb2d557edc98991399bc3fe83d5a4e9ca..676b9c89be2680914e505ab4689c0192b9d63690 100644 (file)
@@ -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.
@@ -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.
index d6a010f4157582b6f583b30e868fc60e016bd76a..51446f3f26fed4d151c479af2a8d93d45fb7fb4a 100644 (file)
@@ -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.
     """
 
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 (file)
index 0000000..00937e5
--- /dev/null
@@ -0,0 +1,2 @@
+Add missing documentation for the ``end_lineno`` and ``end_offset`` attributes
+of the :class:`traceback.TracebackException` class.