gh-108867: Add PyThreadState_GetUnchecked() function (#108870)

Add PyThreadState_GetUnchecked() function: similar to
PyThreadState_Get(), but don't issue a fatal error if it is NULL. The
caller is responsible to check if the result is NULL. Previously,
this function was private and known as _PyThreadState_UncheckedGet().
This commit is contained in:
Victor Stinner 2023-10-03 18:53:51 +02:00 committed by GitHub
parent 6ab6040054
commit d73501602f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
10 changed files with 34 additions and 8 deletions

View file

@ -56,7 +56,7 @@ PyAPI_FUNC(void) PyThreadState_Delete(PyThreadState *);
The caller must hold the GIL.
See also _PyThreadState_UncheckedGet() and _PyThreadState_GET(). */
See also PyThreadState_GetUnchecked() and _PyThreadState_GET(). */
PyAPI_FUNC(PyThreadState *) PyThreadState_Get(void);
// Alias to PyThreadState_Get()