Skip to content

Commit 885ffe8

Browse files
committed
Turn off assert for free-threading
1 parent 68f820f commit 885ffe8

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

Objects/object.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2994,7 +2994,11 @@ _Py_Dealloc(PyObject *op)
29942994
destructor dealloc = type->tp_dealloc;
29952995
#ifdef Py_DEBUG
29962996
PyThreadState *tstate = _PyThreadState_GET();
2997+
#ifndef Py_GIL_DISABLED
2998+
/* This assertion doesn't hold for the free-threading build, as
2999+
* PyStackRef_CLOSE_SPECIALIZED is not implemented */
29973000
assert(tstate->current_frame == NULL || tstate->current_frame->stackpointer != NULL);
3001+
#endif
29983002
PyObject *old_exc = tstate != NULL ? tstate->current_exception : NULL;
29993003
// Keep the old exception type alive to prevent undefined behavior
30003004
// on (tstate->curexc_type != old_exc_type) below

0 commit comments

Comments
 (0)