diff Objects/complexobject.c @ 38533:3031a7110da9 legacy-trunk

Correctly allocate complex types with tp_alloc. (bug #1498638)
author Georg Brandl <georg@python.org>
date Thu, 01 Jun 2006 08:27:32 +0000
parents 20cb13bdf1f0
children 90d5d1fea4f2
line wrap: on
line diff
--- a/Objects/complexobject.c	Thu Jun 01 06:39:19 2006 +0000
+++ b/Objects/complexobject.c	Thu Jun 01 08:27:32 2006 +0000
@@ -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 */
 };