From 9e85366c5de278e08bf4016584be326d3a6539f6 Mon Sep 17 00:00:00 2001 From: Brett Cannon Date: Fri, 6 Oct 2023 11:57:24 -0700 Subject: [PATCH 1/2] Guard `assert(tstate->thread_id > 0)` with `#ifndef HAVE_PTHREAD_STUBS` --- Python/pystate.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Python/pystate.c b/Python/pystate.c index a024ae7e3806a6..849a4eec86af83 100644 --- a/Python/pystate.c +++ b/Python/pystate.c @@ -263,10 +263,10 @@ static void unbind_tstate(PyThreadState *tstate) { assert(tstate != NULL); - // XXX assert(tstate_is_alive(tstate)); assert(tstate_is_bound(tstate)); - // XXX assert(!tstate->_status.active); +#ifndef HAVE_PTHREAD_STUBS assert(tstate->thread_id > 0); +#endif #ifdef PY_HAVE_THREAD_NATIVE_ID assert(tstate->native_thread_id > 0); #endif From 945132223a8670b793cd2cce5dba0e5af104e5b7 Mon Sep 17 00:00:00 2001 From: Brett Cannon Date: Fri, 6 Oct 2023 12:00:51 -0700 Subject: [PATCH 2/2] Add a news entry --- .../2023-10-06-12-00-43.gh-issue-110455.8BjNGg.rst | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 Misc/NEWS.d/next/Core and Builtins/2023-10-06-12-00-43.gh-issue-110455.8BjNGg.rst diff --git a/Misc/NEWS.d/next/Core and Builtins/2023-10-06-12-00-43.gh-issue-110455.8BjNGg.rst b/Misc/NEWS.d/next/Core and Builtins/2023-10-06-12-00-43.gh-issue-110455.8BjNGg.rst new file mode 100644 index 00000000000000..47bf17da757d12 --- /dev/null +++ b/Misc/NEWS.d/next/Core and Builtins/2023-10-06-12-00-43.gh-issue-110455.8BjNGg.rst @@ -0,0 +1,3 @@ +Guard ``assert(tstate->thread_id > 0)`` with ``#ifndef HAVE_PTHREAD_STUBS``. +This allows for for pydebug builds to work under WASI which (currently) +lacks thread support.