mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
only take into account positional arguments count in related error messages
This commit is contained in:
parent
5a3ef5b22a
commit
88968ad380
5 changed files with 16 additions and 6 deletions
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue