diff options
author | Benjamin Peterson <benjamin@python.org> | 2010-06-25 19:30:21 (GMT) |
---|---|---|
committer | Benjamin Peterson <benjamin@python.org> | 2010-06-25 19:30:21 (GMT) |
commit | 88968ad380752227656e2ab4425315e474e26336 (patch) | |
tree | 87d0b51411b7c9910f96629eb1de7072b2a492a2 /Python | |
parent | 5a3ef5b22af607666111c76764db0efffbef82be (diff) | |
download | cpython-88968ad380752227656e2ab4425315e474e26336.zip cpython-88968ad380752227656e2ab4425315e474e26336.tar.gz cpython-88968ad380752227656e2ab4425315e474e26336.tar.bz2 |
only take into account positional arguments count in related error messages
Diffstat (limited to 'Python')
-rw-r--r-- | Python/ceval.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/Python/ceval.c b/Python/ceval.c index 2055acf..6e4911a 100644 --- a/Python/ceval.c +++ b/Python/ceval.c @@ -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; } |