only take into account positional arguments count in related error messages

This commit is contained in:
Benjamin Peterson 2010-06-25 19:30:21 +00:00
parent 5a3ef5b22a
commit 88968ad380
5 changed files with 16 additions and 6 deletions

View file

@ -3100,11 +3100,11 @@ PyEval_EvalCodeEx(PyCodeObject *co, PyObject *globals, PyObject *locals,
if (!(co->co_flags & CO_VARARGS)) {
PyErr_Format(PyExc_TypeError,
"%U() takes %s %d "
"argument%s (%d given)",
"positional argument%s (%d given)",
co->co_name,
defcount ? "at most" : "exactly",
total_args,
total_args == 1 ? "" : "s",
co->co_argcount,
co->co_argcount == 1 ? "" : "s",
argcount + kwcount);
goto fail;
}