Skip to content

Commit acdd8f1

Browse files
committed
On 3.13, Py_IsFinalizing is a supported API, and the private one is gone.
1 parent 6f78188 commit acdd8f1

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

Diff for: src/greenlet/TThreadStateDestroy.cpp

+4
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,11 @@ struct ThreadState_DestroyNoGIL
103103
// segfault if we happen to get context switched, and maybe we should
104104
// just always implement our own AddPendingCall, but I'd like to see if
105105
// this works first
106+
#if GREENLET_PY313
107+
if (Py_IsFinalizing()) {
108+
#else
106109
if (_Py_IsFinalizing()) {
110+
#endif
107111
fprintf(stderr,
108112
"greenlet: WARNING: Interpreter is finalizing. Ignoring "
109113
"call to Py_AddPendingCall; \n");

0 commit comments

Comments
 (0)