summaryrefslogtreecommitdiffstats
path: root/Python/getargs.c
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2019-03-13 21:03:22 (GMT)
committerGitHub <noreply@github.com>2019-03-13 21:03:22 (GMT)
commitf2f55e7f03d332fd43bc665a86d585a79c3b3ed4 (patch)
tree2c45d185d9cdc255a5aee9117e9745f28da454fc /Python/getargs.c
parentd53fe5f407ff4b529628b01a1bcbf21a6aad5c3a (diff)
downloadcpython-f2f55e7f03d332fd43bc665a86d585a79c3b3ed4.zip
cpython-f2f55e7f03d332fd43bc665a86d585a79c3b3ed4.tar.gz
cpython-f2f55e7f03d332fd43bc665a86d585a79c3b3ed4.tar.bz2
bpo-36282: Improved error message for too much positional arguments. (GH-12310)
Diffstat (limited to 'Python/getargs.c')
-rw-r--r--Python/getargs.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/Python/getargs.c b/Python/getargs.c
index 876f5c7..77ded60 100644
--- a/Python/getargs.c
+++ b/Python/getargs.c
@@ -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);