Skip to content

Commit f2aa42e

Browse files
Document that PyErr_SetRaisedException() accepts NULL
Adopted the suggestion to use a note rather than a warning.
1 parent 95034cc commit f2aa42e

1 file changed

Lines changed: 7 additions & 3 deletions

File tree

Doc/c-api/exceptions.rst

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -498,9 +498,13 @@ Querying the error indicator
498498
499499
.. c:function:: void PyErr_SetRaisedException(PyObject *exc)
500500
501-
A stolen reference to *exc* is set as the exception currently being raised,
502-
clearing the existing exception if one is set. *exc* may be ``NULL`` in
503-
which case any current exception is cleared.
501+
Set *exc* as the exception currently being raised, clearing the existing
502+
exception if one is set. *exc* may be ``NULL`` in which case any current
503+
exception is cleared.
504+
505+
.. note::
506+
507+
This function "steals" a reference to *exc*.
504508
505509
.. versionadded:: 3.12
506510

0 commit comments

Comments
 (0)