Skip to content

Commit bac1060

Browse files
committed
Rephrase documentation
1 parent d6bd12f commit bac1060

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

Doc/c-api/init.rst

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1282,8 +1282,14 @@ with sub-interpreters:
12821282
12831283
.. c:function:: int PyGILState_EnsureOrFail(PyGILState_STATE *state)
12841284
1285-
Similar to :c:func:`PyGILState_Ensure`, but *state* is an argument
1286-
and return ``-1`` if the thread must exit. Return ``0`` on success.
1285+
Similar to :c:func:`PyGILState_Ensure`, except that it returns with a status
1286+
code even in the case of failure. Specifically, it returns ``0`` when the
1287+
operation succeeded, and ``-1`` otherwise. In contrast to
1288+
:c:func:`PyGILState_Ensure`, *state* is an argument.
1289+
1290+
In the case of failure, it is *unsafe* to use the Python API following the
1291+
call. Releasing the obtained *state* via :c:func:`PyGILState_Release` should
1292+
only be done in the case of success.
12871293
12881294
.. versionadded:: next
12891295

0 commit comments

Comments
 (0)