diff options
| author | Benjamin Peterson <benjamin@python.org> | 2010-06-25 19:30:21 +0000 |
|---|---|---|
| committer | Benjamin Peterson <benjamin@python.org> | 2010-06-25 19:30:21 +0000 |
| commit | 142b3f5685806ec7e1a0ebba13eacd7762616078 (patch) | |
| tree | 22756f0b57eae9b89f665290771a5f71b5cb7def /Python/ceval.c | |
| parent | c6f5f74f4aefb378611274d3463e3b62f756b9d9 (diff) | |
| download | cpython-142b3f5685806ec7e1a0ebba13eacd7762616078.tar.gz | |
only take into account positional arguments count in related error messages
Diffstat (limited to 'Python/ceval.c')
| -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 2055acf26c..6e4911ae92 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; } |
