From c82449dd1e599064c1c517b8a6a7d3596120cfec Mon Sep 17 00:00:00 2001 From: Kumar Aditya Date: Sun, 26 Oct 2025 18:06:19 +0530 Subject: [PATCH 1/2] fix build for mypyc --- Include/internal/pycore_pystate.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Include/internal/pycore_pystate.h b/Include/internal/pycore_pystate.h index 503cddc73fc464..b35fdf50ccc84b 100644 --- a/Include/internal/pycore_pystate.h +++ b/Include/internal/pycore_pystate.h @@ -209,7 +209,7 @@ static inline PyInterpreterState* _PyInterpreterState_GET(void) { PyThreadState *tstate = _PyThreadState_GET(); _Py_EnsureTstateNotNULL(tstate); #endif -#if !defined(Py_BUILD_CORE_MODULE) +#if defined(HAVE_THREAD_LOCAL) && !defined(Py_BUILD_CORE_MODULE) return _Py_tss_interp; #else return _PyThreadState_GET()->interp; From 34a2688912ee8fd1491dd9dd6bd7634c106a4175 Mon Sep 17 00:00:00 2001 From: Kumar Aditya Date: Tue, 28 Oct 2025 01:08:34 +0530 Subject: [PATCH 2/2] remove HAVE_THREAD_LOCAL --- Include/internal/pycore_pystate.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Include/internal/pycore_pystate.h b/Include/internal/pycore_pystate.h index b35fdf50ccc84b..cab458f84028e2 100644 --- a/Include/internal/pycore_pystate.h +++ b/Include/internal/pycore_pystate.h @@ -89,7 +89,7 @@ _Py_ThreadCanHandleSignals(PyInterpreterState *interp) /* Variable and static inline functions for in-line access to current thread and interpreter state */ -#if defined(HAVE_THREAD_LOCAL) && !defined(Py_BUILD_CORE_MODULE) +#if !defined(Py_BUILD_CORE_MODULE) extern _Py_thread_local PyThreadState *_Py_tss_tstate; extern _Py_thread_local PyInterpreterState *_Py_tss_interp; #endif @@ -115,7 +115,7 @@ PyAPI_FUNC(PyThreadState *) _PyThreadState_GetCurrent(void); static inline PyThreadState* _PyThreadState_GET(void) { -#if defined(HAVE_THREAD_LOCAL) && !defined(Py_BUILD_CORE_MODULE) +#if !defined(Py_BUILD_CORE_MODULE) return _Py_tss_tstate; #else return _PyThreadState_GetCurrent(); @@ -209,7 +209,7 @@ static inline PyInterpreterState* _PyInterpreterState_GET(void) { PyThreadState *tstate = _PyThreadState_GET(); _Py_EnsureTstateNotNULL(tstate); #endif -#if defined(HAVE_THREAD_LOCAL) && !defined(Py_BUILD_CORE_MODULE) +#if !defined(Py_BUILD_CORE_MODULE) return _Py_tss_interp; #else return _PyThreadState_GET()->interp;