summaryrefslogtreecommitdiffstats
path: root/Objects/genobject.c
diff options
context:
space:
mode:
Diffstat (limited to 'Objects/genobject.c')
-rw-r--r--Objects/genobject.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/Objects/genobject.c b/Objects/genobject.c
index f471973..ab523e4 100644
--- a/Objects/genobject.c
+++ b/Objects/genobject.c
@@ -1685,7 +1685,11 @@ _PyAsyncGen_ClearFreeLists(_PyFreeListState *freelist_state, int is_finalization
void
_PyAsyncGen_Fini(_PyFreeListState *state)
{
+ // With Py_GIL_DISABLED:
+ // the freelists for the current thread state have already been cleared.
+#ifndef Py_GIL_DISABLED
_PyAsyncGen_ClearFreeLists(state, 1);
+#endif
}