Skip to content

Commit 74f445f

Browse files
[3.13] gh-101100: Fix reference warnings in c-api/init.rst documenting PyGILState_STATE (GH-139572)
(cherry picked from commit d2deb8f) Co-authored-by: Stan Ulbrych <[email protected]>
1 parent 69a3493 commit 74f445f

File tree

2 files changed

+16
-3
lines changed

2 files changed

+16
-3
lines changed

Doc/c-api/init.rst

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1225,9 +1225,23 @@ code, or when embedding the Python interpreter:
12251225
The :term:`GIL` does not need to be held, but will be held upon returning
12261226
if *tstate* is non-``NULL``.
12271227
1228+
12281229
The following functions use thread-local storage, and are not compatible
12291230
with sub-interpreters:
12301231
1232+
.. c:type:: PyGILState_STATE
1233+
1234+
The type of the value returned by :c:func:`PyGILState_Ensure` and passed to
1235+
:c:func:`PyGILState_Release`.
1236+
1237+
.. c:enumerator:: PyGILState_LOCKED
1238+
1239+
The GIL was already held when :c:func:`PyGILState_Ensure` was called.
1240+
1241+
.. c:enumerator:: PyGILState_UNLOCKED
1242+
1243+
The GIL was not held when :c:func:`PyGILState_Ensure` was called.
1244+
12311245
.. c:function:: PyGILState_STATE PyGILState_Ensure()
12321246
12331247
Ensure that the current thread is ready to call the Python C API regardless
@@ -1372,11 +1386,11 @@ All of the following functions must be called after :c:func:`Py_Initialize`.
13721386
must be held.
13731387
13741388
.. versionchanged:: 3.9
1375-
This function now calls the :c:member:`PyThreadState.on_delete` callback.
1389+
This function now calls the :c:member:`!PyThreadState.on_delete` callback.
13761390
Previously, that happened in :c:func:`PyThreadState_Delete`.
13771391
13781392
.. versionchanged:: 3.13
1379-
The :c:member:`PyThreadState.on_delete` callback was removed.
1393+
The :c:member:`!PyThreadState.on_delete` callback was removed.
13801394
13811395
13821396
.. c:function:: void PyThreadState_Delete(PyThreadState *tstate)

Doc/tools/.nitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44

55
Doc/c-api/descriptor.rst
66
Doc/c-api/float.rst
7-
Doc/c-api/init.rst
87
Doc/c-api/init_config.rst
98
Doc/c-api/intro.rst
109
Doc/c-api/module.rst

0 commit comments

Comments
 (0)