summaryrefslogtreecommitdiffstats
path: root/Doc/c-api
diff options
context:
space:
mode:
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>2023-06-02 16:04:22 (GMT)
committerGitHub <noreply@github.com>2023-06-02 16:04:22 (GMT)
commit00fe6186cb8bb5de9ab1604521dfd2584a487545 (patch)
treebf04c5d2832cd565bd58af8fb0001fd7bf1faf47 /Doc/c-api
parent103ae4e36e965b2d693c90bb6cb699f845903950 (diff)
downloadcpython-00fe6186cb8bb5de9ab1604521dfd2584a487545.zip
cpython-00fe6186cb8bb5de9ab1604521dfd2584a487545.tar.gz
cpython-00fe6186cb8bb5de9ab1604521dfd2584a487545.tar.bz2
[3.12] gh-102778: update documentation of PyErr_PrintEx and traceback.print_last() regarding sys.last_exc (GH-105190) (#105246)
gh-102778: update documentation of PyErr_PrintEx and traceback.print_last() regarding sys.last_exc (GH-105190) (cherry picked from commit 0dafc785ee6629dbcb9bec6f7aee43a56cd0b26e) Co-authored-by: Irit Katriel <1055913+iritkatriel@users.noreply.github.com>
Diffstat (limited to 'Doc/c-api')
-rw-r--r--Doc/c-api/exceptions.rst11
1 files changed, 8 insertions, 3 deletions
diff --git a/Doc/c-api/exceptions.rst b/Doc/c-api/exceptions.rst
index dc73ad8..1694aa2 100644
--- a/Doc/c-api/exceptions.rst
+++ b/Doc/c-api/exceptions.rst
@@ -60,9 +60,14 @@ Printing and clearing
Call this function **only** when the error indicator is set. Otherwise it
will cause a fatal error!
- If *set_sys_last_vars* is nonzero, the variables :data:`sys.last_type`,
- :data:`sys.last_value` and :data:`sys.last_traceback` will be set to the
- type, value and traceback of the printed exception, respectively.
+ If *set_sys_last_vars* is nonzero, the variable :data:`sys.last_exc` is
+ set to the printed exception. For backwards compatibility, the
+ deprecated variables :data:`sys.last_type`, :data:`sys.last_value` and
+ :data:`sys.last_traceback` are also set to the type, value and traceback
+ of this exception, respectively.
+
+ .. versionchanged:: 3.12
+ The setting of :data:`sys.last_exc` was added.
.. c:function:: void PyErr_Print()