From 3dfc3c14a20de3c35262e2e798159f7a64611437 Mon Sep 17 00:00:00 2001 From: Thomas Wouters Date: Mon, 21 Aug 2006 22:15:41 +0000 Subject: [PATCH] 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_*. --- Modules/gcmodule.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Modules/gcmodule.c b/Modules/gcmodule.c index 5c2f3816e1f..99f2897e53d 100644 --- a/Modules/gcmodule.c +++ b/Modules/gcmodule.c @@ -411,7 +411,7 @@ has_finalizer(PyObject *op) 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`.