Skip to content

Commit 2465fe0

Browse files
[3.12] GH-110455: Guard assert(tstate->thread_id > 0) with GH-ifndef HAVE_PTHREAD_STUBS (GH-110487) (GH-110491)
GH-110455: Guard `assert(tstate->thread_id > 0)` with `GH-ifndef HAVE_PTHREAD_STUBS` (GH-110487) (cherry picked from commit 5fd8821) Co-authored-by: Brett Cannon <[email protected]>
1 parent b77f5ee commit 2465fe0

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
Guard ``assert(tstate->thread_id > 0)`` with ``#ifndef HAVE_PTHREAD_STUBS``.
2+
This allows for for pydebug builds to work under WASI which (currently)
3+
lacks thread support.

Python/pystate.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -264,10 +264,10 @@ static void
264264
unbind_tstate(PyThreadState *tstate)
265265
{
266266
assert(tstate != NULL);
267-
// XXX assert(tstate_is_alive(tstate));
268267
assert(tstate_is_bound(tstate));
269-
// XXX assert(!tstate->_status.active);
268+
#ifndef HAVE_PTHREAD_STUBS
270269
assert(tstate->thread_id > 0);
270+
#endif
271271
#ifdef PY_HAVE_THREAD_NATIVE_ID
272272
assert(tstate->native_thread_id > 0);
273273
#endif

0 commit comments

Comments
 (0)