Skip to content

Commit 3cefb64

Browse files
[3.14] gh-150663: Document that PyErr_SetRaisedException accepts null (GH-153046) (#154022)
gh-150663: Document that PyErr_SetRaisedException accepts null (GH-153046) (cherry picked from commit a0c8329) Co-authored-by: Andrii Hrimov <andrew.hrimov@gmail.com>
1 parent be6f920 commit 3cefb64

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

Doc/c-api/exceptions.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -499,12 +499,12 @@ Querying the error indicator
499499
.. c:function:: void PyErr_SetRaisedException(PyObject *exc)
500500
501501
Set *exc* as the exception currently being raised,
502-
clearing the existing exception if one is set.
502+
clearing the existing exception if one is set. If *exc* is ``NULL``,
503+
just clear the existing exception.
503504
504-
.. warning::
505+
*exc* must be a valid exception or ``NULL``.
505506
506-
This call ":term:`steals <steal>`" a reference to *exc*,
507-
which must be a valid exception.
507+
This call ":term:`steals <steal>`" a reference to *exc*.
508508
509509
.. versionadded:: 3.12
510510

0 commit comments

Comments
 (0)