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.
This commit is contained in:
Guido van Rossum 2002-08-23 14:11:35 +00:00
parent b2628b0f37
commit 86c659a329
1 changed files with 2 additions and 2 deletions

View File

@ -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);
} }