Skip to content

Commit 9b938c7

Browse files
committed
Update code-object watcher docs on return value also
1 parent b5256e7 commit 9b938c7

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

Doc/c-api/code.rst

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -185,9 +185,10 @@ bound into a function.
185185
(including whether a callback is invoked or not), it does not change
186186
the semantics of the Python code being executed.
187187
188-
If the callback returns with an exception set, it must return ``-1``; this
189-
exception will be printed as an unraisable exception using
190-
:c:func:`PyErr_WriteUnraisable`. Otherwise it should return ``0``.
188+
If the callback sets an exception, it must return ``-1``; this exception will
189+
be printed as an unraisable exception using :c:func:`PyErr_WriteUnraisable`.
190+
Otherwise (including if an exception was already set on entry to the
191+
callback) it should return ``0``.
191192
192193
.. versionadded:: 3.12
193194

0 commit comments

Comments
 (0)