From bb91678bc40587dd1b60febb70ec5639d2d765bf Mon Sep 17 00:00:00 2001 From: Wojusensei <3442006415@qq.com> Date: Sat, 4 Jul 2026 16:49:36 +0800 Subject: [PATCH] gh-152798: Return 'pymutex' on POSIX except Windows/WASI --- Python/thread.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/Python/thread.c b/Python/thread.c index 0365f977d82b0ed..8660e7cbad51f28 100644 --- a/Python/thread.c +++ b/Python/thread.c @@ -334,6 +334,11 @@ PyThread_GetInfo(void) #ifdef HAVE_PTHREAD_STUBS value = Py_NewRef(Py_None); +#else +#ifdef MS_WINDOWS + value = Py_NewRef(Py_None); +#elif defined(__wasi__) + value = Py_NewRef(Py_None); #else value = PyUnicode_FromString("pymutex"); if (value == NULL) { @@ -341,6 +346,8 @@ PyThread_GetInfo(void) return NULL; } #endif +#endif + PyStructSequence_SET_ITEM(threadinfo, pos++, value); #if (defined(_POSIX_THREADS) && defined(HAVE_CONFSTR) \ @@ -361,7 +368,6 @@ PyThread_GetInfo(void) return threadinfo; } - void _PyThread_FiniType(PyInterpreterState *interp) {