Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Address CAM's first round of review
  • Loading branch information
erlend-aasland committed Feb 17, 2023
commit 415a70d044e997e88abe3727cc4f030c87e49564
16 changes: 10 additions & 6 deletions Doc/c-api/exceptions.rst
Original file line number Diff line number Diff line change
Expand Up @@ -408,7 +408,7 @@ Querying the error indicator
This function is used by code that needs to catch exceptions,
or code that needs to save and restore the error indicator temporarily.

Example::
For example::

{
PyObject *exc = PyErr_GetRaisedException();
Expand All @@ -418,10 +418,13 @@ Querying the error indicator
PyErr_SetRaisedException(exc);
}

Use :c:func:`PyErr_GetHandledException` to fetch the exception
currently being handled.
.. seealso::

.. seealso:: :c:func:`PyErr_SetRaisedException`
* :c:func:`PyErr_SetRaisedException`,
to set the current raised exception.

* :c:func:`PyErr_GetHandledException`,
to fetch the exception currently being handled.

Comment thread
erlend-aasland marked this conversation as resolved.
Outdated
.. versionadded:: 3.12

Expand All @@ -431,11 +434,12 @@ Querying the error indicator
Set *exc* as the exception currently being raised.
If another exception is already raised, it is cleared first.
Comment thread
erlend-aasland marked this conversation as resolved.
Outdated

.. note::
.. caution::
Comment thread
erlend-aasland marked this conversation as resolved.
Outdated

This call steals a reference to *exc*, which must be a valid exception.

.. seealso:: :c:func:`PyErr_GetRaisedException`
.. seealso:: :c:func:`PyErr_GetRaisedException`,
to save the current raised exception.

.. versionadded:: 3.12

Expand Down