File tree 2 files changed +26
-11
lines changed
2 files changed +26
-11
lines changed Original file line number Diff line number Diff line change @@ -870,6 +870,19 @@ New Features
870
870
get a frame variable by its name.
871
871
(Contributed by Victor Stinner in :gh: `91248 `.)
872
872
873
+ * Add :c:func: `PyErr_GetRaisedException ` and :c:func: `PyErr_SetRaisedException `
874
+ for saving and restoring the current exception.
875
+ These functions return and accept a single exception object,
876
+ rather than the triple arguments of the now-deprecated
877
+ :c:func: `PyErr_Fetch ` and :c:func: `PyErr_Restore `.
878
+ This is less error prone and a bit more efficient.
879
+ (Contributed by Mark Shannon in :gh: `101578 `.)
880
+
881
+ * Add :c:func: `PyException_GetArgs ` and :c:func: `PyException_SetArgs `
882
+ as convenience functions for retrieving and modifying
883
+ the :attr: `~BaseException.args ` passed to the exception's constructor.
884
+ (Contributed by Mark Shannon in :gh: `101578 `.)
885
+
873
886
Porting to Python 3.12
874
887
----------------------
875
888
@@ -993,6 +1006,11 @@ Deprecated
993
1006
(Contributed in :gh: `47146 ` by Petr Viktorin, based on
994
1007
earlier work by Alexander Belopolsky and Matthias Braun.)
995
1008
1009
+ * :c:func: `PyErr_Fetch ` and :c:func: `PyErr_Restore ` are deprecated.
1010
+ Use :c:func: `PyErr_GetRaisedException ` and
1011
+ :c:func: `PyErr_SetRaisedException ` instead.
1012
+ (Contributed by Mark Shannon in :gh: `101578 `.)
1013
+
996
1014
997
1015
Removed
998
1016
-------
Original file line number Diff line number Diff line change 1
- Add new C-API functions for saving and restoring the current exception:
2
- ``PyErr_GetRaisedException `` and ``PyErr_SetRaisedException ``.
3
- These functions take and return a single exception rather than
4
- the triple of ``PyErr_Fetch `` and ``PyErr_Restore ``.
1
+ Add :c:func: `PyErr_GetRaisedException ` and :c:func: `PyErr_SetRaisedException `
2
+ for saving and restoring the current exception.
3
+ These functions return and accept a single exception object,
4
+ rather than the triple arguments of the now-deprecated
5
+ :c:func: `PyErr_Fetch ` and :c:func: `PyErr_Restore `.
5
6
This is less error prone and a bit more efficient.
6
7
7
- The three arguments forms of saving and restoring the
8
- current exception: ``PyErr_Fetch `` and ``PyErr_Restore ``
9
- are deprecated.
10
-
11
- Also add ``PyException_GetArgs `` and ``PyException_SetArgs ``
12
- as convenience functions to help dealing with
13
- exceptions in the C API.
8
+ Add :c:func: `PyException_GetArgs ` and :c:func: `PyException_SetArgs `
9
+ as convenience functions for retrieving and modifying
10
+ the :attr: `~BaseException.args ` passed to the exception's constructor.
You can’t perform that action at this time.
0 commit comments