We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 4bf4187 commit 2c6dd5cCopy full SHA for 2c6dd5c
Python/gc.c
@@ -1003,10 +1003,11 @@ handle_legacy_finalizers(PyThreadState *tstate,
1003
assert(!_PyErr_Occurred(tstate));
1004
assert(gcstate->garbage != NULL);
1005
1006
+ int old_space = gc_old_space(old);
1007
PyGC_Head *gc = GC_NEXT(finalizers);
1008
for (; gc != finalizers; gc = GC_NEXT(gc)) {
1009
+ gc_set_old_space(gc, old_space);
1010
PyObject *op = FROM_GC(gc);
-
1011
if ((gcstate->debug & _PyGC_DEBUG_SAVEALL) || has_legacy_finalizer(op)) {
1012
if (PyList_Append(gcstate->garbage, op) < 0) {
1013
_PyErr_Clear(tstate);
0 commit comments