From e2cf4741550d275bc7b07ae8964f847690eb3ac5 Mon Sep 17 00:00:00 2001 From: Peter Bierma Date: Sun, 11 May 2025 10:25:07 -0400 Subject: [PATCH] Fix PyThreadState_Swap() documentation --- Doc/c-api/init.rst | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Doc/c-api/init.rst b/Doc/c-api/init.rst index 36a4976010bde6..323dc9968281e6 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: