Add check to conjugate() that there are no excess arguments.
This commit is contained in:
parent
dda6696be6
commit
8530ef625a
@ -573,17 +573,20 @@ complex_float(v)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static PyObject *
|
static PyObject *
|
||||||
complex_conjugate(self)
|
complex_conjugate(self, args)
|
||||||
PyObject *self;
|
PyObject *self;
|
||||||
|
PyObject *args;
|
||||||
{
|
{
|
||||||
Py_complex c;
|
Py_complex c;
|
||||||
|
if (!PyArg_ParseTuple(args, ""))
|
||||||
|
return NULL;
|
||||||
c = ((PyComplexObject *)self)->cval;
|
c = ((PyComplexObject *)self)->cval;
|
||||||
c.imag = -c.imag;
|
c.imag = -c.imag;
|
||||||
return PyComplex_FromCComplex(c);
|
return PyComplex_FromCComplex(c);
|
||||||
}
|
}
|
||||||
|
|
||||||
static PyMethodDef complex_methods[] = {
|
static PyMethodDef complex_methods[] = {
|
||||||
{"conjugate", (PyCFunction)complex_conjugate, 1},
|
{"conjugate", complex_conjugate, 1},
|
||||||
{NULL, NULL} /* sentinel */
|
{NULL, NULL} /* sentinel */
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user