diff options
author | Erlend E. Aasland <erlend.aasland@protonmail.com> | 2023-02-23 12:19:21 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-02-23 12:19:21 (GMT) |
commit | 5b9573eed43c9a43bf0cf54fe012413e08cce34f (patch) | |
tree | 62eeb07ae9090a895b01566471d47f17ef89a1ce /Doc/whatsnew | |
parent | 22b8d77b98a5944e688be0927b8139c49d4a7257 (diff) | |
download | cpython-5b9573eed43c9a43bf0cf54fe012413e08cce34f.zip cpython-5b9573eed43c9a43bf0cf54fe012413e08cce34f.tar.gz cpython-5b9573eed43c9a43bf0cf54fe012413e08cce34f.tar.bz2 |
gh-101578: Fixup NEWS and add What's New entry for new exception APIs (#102157)
Diffstat (limited to 'Doc/whatsnew')
-rw-r--r-- | Doc/whatsnew/3.12.rst | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/Doc/whatsnew/3.12.rst b/Doc/whatsnew/3.12.rst index 909c910..e551c5b 100644 --- a/Doc/whatsnew/3.12.rst +++ b/Doc/whatsnew/3.12.rst @@ -870,6 +870,19 @@ New Features get a frame variable by its name. (Contributed by Victor Stinner in :gh:`91248`.) +* Add :c:func:`PyErr_GetRaisedException` and :c:func:`PyErr_SetRaisedException` + for saving and restoring the current exception. + These functions return and accept a single exception object, + rather than the triple arguments of the now-deprecated + :c:func:`PyErr_Fetch` and :c:func:`PyErr_Restore`. + This is less error prone and a bit more efficient. + (Contributed by Mark Shannon in :gh:`101578`.) + +* Add :c:func:`PyException_GetArgs` and :c:func:`PyException_SetArgs` + as convenience functions for retrieving and modifying + the :attr:`~BaseException.args` passed to the exception's constructor. + (Contributed by Mark Shannon in :gh:`101578`.) + Porting to Python 3.12 ---------------------- @@ -993,6 +1006,11 @@ Deprecated (Contributed in :gh:`47146` by Petr Viktorin, based on earlier work by Alexander Belopolsky and Matthias Braun.) +* :c:func:`PyErr_Fetch` and :c:func:`PyErr_Restore` are deprecated. + Use :c:func:`PyErr_GetRaisedException` and + :c:func:`PyErr_SetRaisedException` instead. + (Contributed by Mark Shannon in :gh:`101578`.) + Removed ------- |