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_*.
diff --git a/Modules/gcmodule.c b/Modules/gcmodule.c
index 5c2f381..99f2897 100644
--- a/Modules/gcmodule.c
+++ b/Modules/gcmodule.c
@@ -411,7 +411,7 @@
if (PyGen_CheckExact(op))
return PyGen_NeedsFinalizing((PyGenObject *)op);
else
- return 0;
+ return op->ob_type->tp_del != NULL;
}
/* Move the objects in unreachable with __del__ methods into `finalizers`.