aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/Python/context.c
diff options
context:
space:
mode:
Diffstat (limited to 'Python/context.c')
-rw-r--r--Python/context.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/Python/context.c b/Python/context.c
index 294485e5b40..793dfa2b72c 100644
--- a/Python/context.c
+++ b/Python/context.c
@@ -1287,7 +1287,11 @@ _PyContext_ClearFreeList(_PyFreeListState *freelist_state, int is_finalization)
void
_PyContext_Fini(_PyFreeListState *state)
{
+ // With Py_GIL_DISABLED:
+ // the freelists for the current thread state have already been cleared.
+#ifndef Py_GIL_DISABLED
_PyContext_ClearFreeList(state, 1);
+#endif
}