Commit b20cd970 authored by Guido van Rossum's avatar Guido van Rossum

The error messages in err_args() -- which is only called when the

required number of args is 0 or 1 -- were reversed.  Also change "1"
into "exactly one", the same words as used elsewhere for this
condition.
parent 9a6bc502
...@@ -3176,12 +3176,12 @@ err_args(PyObject *func, int flags, int nargs) ...@@ -3176,12 +3176,12 @@ err_args(PyObject *func, int flags, int nargs)
{ {
if (flags & METH_NOARGS) if (flags & METH_NOARGS)
PyErr_Format(PyExc_TypeError, PyErr_Format(PyExc_TypeError,
"%.200s() takes 1 argument (%d given)", "%.200s() takes no arguments (%d given)",
((PyCFunctionObject *)func)->m_ml->ml_name, ((PyCFunctionObject *)func)->m_ml->ml_name,
nargs); nargs);
else else
PyErr_Format(PyExc_TypeError, PyErr_Format(PyExc_TypeError,
"%.200s() takes no arguments (%d given)", "%.200s() takes exactly one argument (%d given)",
((PyCFunctionObject *)func)->m_ml->ml_name, ((PyCFunctionObject *)func)->m_ml->ml_name,
nargs); nargs);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment