Skip to content

Commit 4d07172

Browse files
Document that PyErr_SetRaisedException() accepts NULL
Removed the warning and expanded the main part of the explanation.
1 parent 3e1e83a commit 4d07172

1 file changed

Lines changed: 3 additions & 7 deletions

File tree

Doc/c-api/exceptions.rst

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -498,13 +498,9 @@ Querying the error indicator
498498
499499
.. c:function:: void PyErr_SetRaisedException(PyObject *exc)
500500
501-
Set *exc* as the exception currently being raised,
502-
clearing the existing exception if one is set.
503-
504-
.. warning::
505-
506-
*exc* must be a valid exception (in which case a reference is stolen) or
507-
``NULL``.
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.
508504
509505
.. versionadded:: 3.12
510506

0 commit comments

Comments
 (0)