GH-110455: Guard `assert(tstate->thread_id > 0)` with `GH-ifndef HAVE_PTHREAD_STUBS` (GH-110487)
(cherry picked from commit
5fd8821cf8eb1fe2e8575f8c7cc747cf78855a88)
Co-authored-by: Brett Cannon <brett@python.org>
--- /dev/null
+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.
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