From: Thomas Wouters Date: Mon, 21 Aug 2006 22:15:41 +0000 (+0000) Subject: Fix test_gc failure by fixing the bug test_gc found: __del__ methods were no X-Git-Tag: v3.0a1~1365 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=3dfc3c14a20de3c35262e2e798159f7a64611437;p=thirdparty%2FPython%2Fcpython.git 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 5c2f3816e1f8..99f2897e53d7 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`.