Add check to conjugate() that there are no excess arguments.

This commit is contained in:
Guido van Rossum 1998-05-07 16:29:10 +00:00
parent dda6696be6
commit 8530ef625a

View File

@ -573,17 +573,20 @@ complex_float(v)
}
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 */
};