Skip to content

Commit a1ade06

Browse files
authored
restore the previous idiom in callbacks.c
1 parent 618f2bf commit a1ade06

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

Modules/_ctypes/callbacks.c

+5-1
Original file line numberDiff line numberDiff line change
@@ -348,7 +348,11 @@ CThunkObject *_ctypes_alloc_callback(PyObject *callable,
348348
if (p == NULL) {
349349
return NULL;
350350
}
351-
assert(CThunk_CheckExact(GLOBAL_STATE(), (PyObject *)p));
351+
352+
#ifdef Py_DEBUG
353+
ctypes_state *st = GLOBAL_STATE();
354+
assert(CThunk_CheckExact(st, (PyObject *)p));
355+
#endif
352356

353357
p->pcl_write = Py_ffi_closure_alloc(sizeof(ffi_closure), &p->pcl_exec);
354358
if (p->pcl_write == NULL) {

0 commit comments

Comments
 (0)