diff Objects/complexobject.c @ 8261:b8ba8887d59f legacy-trunk

Add check to conjugate() that there are no excess arguments.
author Guido van Rossum <guido@python.org>
date Thu, 07 May 1998 16:29:10 +0000
parents 1eced1aaad5a
children 93b9eafe1f1d
line wrap: on
line diff
--- a/Objects/complexobject.c	Thu May 07 15:32:44 1998 +0000
+++ b/Objects/complexobject.c	Thu May 07 16:29:10 1998 +0000
@@ -573,17 +573,20 @@
 }
 
 static PyObject *
-complex_conjugate(self)
+complex_conjugate(self, args)
 	PyObject *self;
+	PyObject *args;
 {
 	Py_complex c;
+	if (!PyArg_ParseTuple(args, ""))
+		return NULL;
 	c = ((PyComplexObject *)self)->cval;
 	c.imag = -c.imag;
 	return PyComplex_FromCComplex(c);
 }
 
 static PyMethodDef complex_methods[] = {
-	{"conjugate",	(PyCFunction)complex_conjugate,	1},
+	{"conjugate",	complex_conjugate,	1},
 	{NULL,		NULL}		/* sentinel */
 };