From 426d9eaccf30aa5d19b5fa4c8760cdb6f6916cbf Mon Sep 17 00:00:00 2001 From: Victor Stinner Date: Wed, 15 Nov 2023 19:15:03 +0100 Subject: [PATCH] gh-112026: Add again _PyThreadState_UncheckedGet() function (#112121) Add again the private _PyThreadState_UncheckedGet() function as an alias to the new public PyThreadState_GetUnchecked() function. --- Include/cpython/pystate.h | 3 +++ .../next/C API/2023-11-15-18-36-21.gh-issue-112026._Yybr5.rst | 3 +++ 2 files changed, 6 insertions(+) create mode 100644 Misc/NEWS.d/next/C API/2023-11-15-18-36-21.gh-issue-112026._Yybr5.rst diff --git a/Include/cpython/pystate.h b/Include/cpython/pystate.h index 7f2378ae76fe5c3..decafde474b029d 100644 --- a/Include/cpython/pystate.h +++ b/Include/cpython/pystate.h @@ -231,6 +231,9 @@ struct _ts { * if it is NULL. */ PyAPI_FUNC(PyThreadState *) PyThreadState_GetUnchecked(void); +// Alias kept for backward compatibility +#define _PyThreadState_UncheckedGet PyThreadState_GetUnchecked + // Disable tracing and profiling. PyAPI_FUNC(void) PyThreadState_EnterTracing(PyThreadState *tstate); diff --git a/Misc/NEWS.d/next/C API/2023-11-15-18-36-21.gh-issue-112026._Yybr5.rst b/Misc/NEWS.d/next/C API/2023-11-15-18-36-21.gh-issue-112026._Yybr5.rst new file mode 100644 index 000000000000000..0c39c78a78d1e05 --- /dev/null +++ b/Misc/NEWS.d/next/C API/2023-11-15-18-36-21.gh-issue-112026._Yybr5.rst @@ -0,0 +1,3 @@ +Add again the private ``_PyThreadState_UncheckedGet()`` function as an alias +to the new public :c:func:`PyThreadState_GetUnchecked` function. Patch by +Victor Stinner.