summaryrefslogtreecommitdiffstats
path: root/Objects
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>1998-05-07 16:29:10 (GMT)
committerGuido van Rossum <guido@python.org>1998-05-07 16:29:10 (GMT)
commit8530ef625aabda9d11ffcee8c4c6fd7230c05185 (patch)
tree7f9f4b2f23da318f4f312ed071855e88de123c1a /Objects
parentdda6696be67bedf4d5547e8bf597cb7cd4769c69 (diff)
downloadcpython-8530ef625aabda9d11ffcee8c4c6fd7230c05185.zip
cpython-8530ef625aabda9d11ffcee8c4c6fd7230c05185.tar.gz
cpython-8530ef625aabda9d11ffcee8c4c6fd7230c05185.tar.bz2
Add check to conjugate() that there are no excess arguments.
Diffstat (limited to 'Objects')
-rw-r--r--Objects/complexobject.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/Objects/complexobject.c b/Objects/complexobject.c
index a186c8e..2e97713 100644
--- a/Objects/complexobject.c
+++ b/Objects/complexobject.c
@@ -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 */
};