summaryrefslogtreecommitdiffstats
path: root/Objects/genobject.c
diff options
context:
space:
mode:
Diffstat (limited to 'Objects/genobject.c')
-rw-r--r--Objects/genobject.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/Objects/genobject.c b/Objects/genobject.c
index bad485c..b0c8054 100644
--- a/Objects/genobject.c
+++ b/Objects/genobject.c
@@ -28,7 +28,7 @@ gen_dealloc(PyGenObject *gen)
if (gen->gi_frame != NULL && gen->gi_frame->f_stacktop != NULL) {
/* Generator is paused, so we need to close */
- gen->ob_type->tp_del(self);
+ Py_Type(gen)->tp_del(self);
if (self->ob_refcnt > 0)
return; /* resurrected. :( */
}
@@ -295,8 +295,7 @@ static PyMethodDef gen_methods[] = {
};
PyTypeObject PyGen_Type = {
- PyObject_HEAD_INIT(&PyType_Type)
- 0, /* ob_size */
+ PyVarObject_HEAD_INIT(&PyType_Type, 0)
"generator", /* tp_name */
sizeof(PyGenObject), /* tp_basicsize */
0, /* tp_itemsize */