]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Fix test_gc failure by fixing the bug test_gc found: __del__ methods were no
authorThomas Wouters <thomas@python.org>
Mon, 21 Aug 2006 22:15:41 +0000 (22:15 +0000)
committerThomas Wouters <thomas@python.org>
Mon, 21 Aug 2006 22:15:41 +0000 (22:15 +0000)
longer preventing classes from being cleaned up by the cycle-gc, after Guido
removed references to PyInstance_*.

Modules/gcmodule.c

index 5c2f3816e1f8cdb0e632396e1373bae97d7df474..99f2897e53d79525cfb6cd183394e3ee3f8b05c0 100644 (file)
@@ -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`.