]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
[3.13] Docs: C API: Fix the incorrect `PyThreadState_Swap` documentation (#133900)
authorPeter Bierma <zintensitydev@gmail.com>
Mon, 19 May 2025 12:54:00 +0000 (08:54 -0400)
committerGitHub <noreply@github.com>
Mon, 19 May 2025 12:54:00 +0000 (18:24 +0530)
Doc/c-api/init.rst

index 36a4976010bde66ccb6c4e2bfb468be84b45adeb..323dc9968281e682cf4f0988e87c52168c0b8df6 100644 (file)
@@ -1190,9 +1190,10 @@ code, or when embedding the Python interpreter:
 .. c:function:: PyThreadState* PyThreadState_Swap(PyThreadState *tstate)
 
    Swap the current thread state with the thread state given by the argument
-   *tstate*, which may be ``NULL``.  The global interpreter lock must be held
-   and is not released.
+   *tstate*, which may be ``NULL``.
 
+   The :term:`GIL` does not need to be held, but will be held upon returning
+   if *tstate* is non-``NULL``.
 
 The following functions use thread-local storage, and are not compatible
 with sub-interpreters: