Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 3dfc3c1

Browse files
committed
Fix test_gc failure by fixing the bug test_gc found: __del__ methods were no
longer preventing classes from being cleaned up by the cycle-gc, after Guido removed references to PyInstance_*.
1 parent 2bb5f1d commit 3dfc3c1

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

Modules/gcmodule.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -411,7 +411,7 @@ has_finalizer(PyObject *op)
411411
if (PyGen_CheckExact(op))
412412
return PyGen_NeedsFinalizing((PyGenObject *)op);
413413
else
414-
return 0;
414+
return op->ob_type->tp_del != NULL;
415415
}
416416

417417
/* Move the objects in unreachable with __del__ methods into `finalizers`.

0 commit comments

Comments
 (0)