From: Peter Bierma Date: Mon, 19 May 2025 12:54:00 +0000 (-0400) Subject: [3.13] Docs: C API: Fix the incorrect `PyThreadState_Swap` documentation (#133900) X-Git-Tag: v3.13.4~90 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=8d92823ecade2543a8c1f47c0557e204d665074c;p=thirdparty%2FPython%2Fcpython.git [3.13] Docs: C API: Fix the incorrect `PyThreadState_Swap` documentation (#133900) --- diff --git a/Doc/c-api/init.rst b/Doc/c-api/init.rst index 36a4976010bd..323dc9968281 100644 --- a/Doc/c-api/init.rst +++ b/Doc/c-api/init.rst @@ -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: