summaryrefslogtreecommitdiffstats
path: root/Modules/gcmodule.c
diff options
context:
space:
mode:
authorAntoine Pitrou <solipsis@pitrou.net>2013-05-08 16:12:35 (GMT)
committerAntoine Pitrou <solipsis@pitrou.net>2013-05-08 16:12:35 (GMT)
commit04e70d19e7a5ab0cea7d3d231606180226e16f06 (patch)
treea1956f14fe0e89e656fd2161178dad0e25ff4b14 /Modules/gcmodule.c
parent070cb3c9bed3fbdbda42c257e05d46adcbeb784e (diff)
downloadcpython-04e70d19e7a5ab0cea7d3d231606180226e16f06.zip
cpython-04e70d19e7a5ab0cea7d3d231606180226e16f06.tar.gz
cpython-04e70d19e7a5ab0cea7d3d231606180226e16f06.tar.bz2
Issue #17807: Generators can now be finalized even when they are part of a reference cycle.
Diffstat (limited to 'Modules/gcmodule.c')
-rw-r--r--Modules/gcmodule.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/Modules/gcmodule.c b/Modules/gcmodule.c
index 4315d55..49251cd 100644
--- a/Modules/gcmodule.c
+++ b/Modules/gcmodule.c
@@ -524,10 +524,7 @@ untrack_dicts(PyGC_Head *head)
static int
has_finalizer(PyObject *op)
{
- if (PyGen_CheckExact(op))
- return PyGen_NeedsFinalizing((PyGenObject *)op);
- else
- return op->ob_type->tp_del != NULL;
+ return op->ob_type->tp_del != NULL;
}
/* Move the objects in unreachable with __del__ methods into `finalizers`.