bpo-36282: Improved error message for too much positional arguments. (GH-12310)

This commit is contained in:
Serhiy Storchaka 2019-03-13 23:03:22 +02:00 committed by GitHub
parent d53fe5f407
commit f2f55e7f03
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 4 additions and 2 deletions

View file

@ -2137,7 +2137,7 @@ vgetargskeywordsfast_impl(PyObject *const *args, Py_ssize_t nargs,
"%.200s%s takes %s %d positional argument%s (%d given)",
(parser->fname == NULL) ? "function" : parser->fname,
(parser->fname == NULL) ? "" : "()",
(parser->min != INT_MAX) ? "at most" : "exactly",
(parser->min < parser->max) ? "at most" : "exactly",
parser->max,
parser->max == 1 ? "" : "s",
nargs);