Skip to content
Prev Previous commit
Next Next commit
Fix up news entry
  • Loading branch information
markshannon committed Feb 7, 2023
commit 1ae8eda968f786af116a2fcfc619cc39d0ae84e7
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
Deprecate the three arguments forms of :cfunc:`PyErr_Fetch` and
:cfunc:`PyErr_Restore` and replace them with one argument forms that take
and return the exception object. Also add :cfunc:`PyException_GetArgs` and
:cfunc:`PyException_SetArgs` as convenience functions to help dealing with
Add new C-API functions for saving and restoring the current exception:
``PyErr_GetRaisedException`` and ``PyErr_SetRaisedException``.
These functions take and return a single exception rather than
the triple of ``PyErr_Fetch`` and ``PyErr_Restore``.
This is less error prone and a bit more efficient.

The three arguments forms of saving and restoring the
current exception: ``PyErr_Fetch`` and ``PyErr_Restore``
are deprecated.

Also add ``PyException_GetArgs`` and ``PyException_SetArgs``
as convenience functions to help dealing with
exceptions in the C API.