Backout c89febab4648 following private feedback by Guido.

(Issue #17807: Generators can now be finalized even when they are part of a reference cycle)
This commit is contained in:
Antoine Pitrou 2013-05-14 20:37:52 +02:00
parent b710d7e4c3
commit 9396356948
8 changed files with 245 additions and 335 deletions

View file

@ -524,7 +524,10 @@ untrack_dicts(PyGC_Head *head)
static int
has_finalizer(PyObject *op)
{
return op->ob_type->tp_del != NULL;
if (PyGen_CheckExact(op))
return PyGen_NeedsFinalizing((PyGenObject *)op);
else
return op->ob_type->tp_del != NULL;
}
/* Move the objects in unreachable with __del__ methods into `finalizers`.