Correctly allocate complex types with tp_alloc. (bug #1498638)
diff --git a/Objects/complexobject.c b/Objects/complexobject.c
index 17aef8f..4c6ea39 100644
--- a/Objects/complexobject.c
+++ b/Objects/complexobject.c
@@ -188,7 +188,7 @@
{
PyObject *op;
- op = PyType_GenericAlloc(type, 0);
+ op = type->tp_alloc(type, 0);
if (op != NULL)
((PyComplexObject *)op)->cval = cval;
return op;
@@ -1023,7 +1023,7 @@
0, /* tp_descr_set */
0, /* tp_dictoffset */
0, /* tp_init */
- 0, /* tp_alloc */
+ PyType_GenericAlloc, /* tp_alloc */
complex_new, /* tp_new */
PyObject_Del, /* tp_free */
};