summaryrefslogtreecommitdiff
path: root/Python/getargs.c
diff options
context:
space:
mode:
Diffstat (limited to 'Python/getargs.c')
-rw-r--r--Python/getargs.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/Python/getargs.c b/Python/getargs.c
index 992cb216c2..98823f22ed 100644
--- a/Python/getargs.c
+++ b/Python/getargs.c
@@ -2411,8 +2411,8 @@ unpack_stack(PyObject *const *args, Py_ssize_t nargs, const char *name,
if (name != NULL)
PyErr_Format(
PyExc_TypeError,
- "%.200s expected %s%zd arguments, got %zd",
- name, (min == max ? "" : "at least "), min, nargs);
+ "%.200s expected %s%zd argument%s, got %zd",
+ name, (min == max ? "" : "at least "), min, min == 1 ? "" : "s", nargs);
else
PyErr_Format(
PyExc_TypeError,
@@ -2430,8 +2430,8 @@ unpack_stack(PyObject *const *args, Py_ssize_t nargs, const char *name,
if (name != NULL)
PyErr_Format(
PyExc_TypeError,
- "%.200s expected %s%zd arguments, got %zd",
- name, (min == max ? "" : "at most "), max, nargs);
+ "%.200s expected %s%zd argument%s, got %zd",
+ name, (min == max ? "" : "at most "), max, max == 1 ? "" : "s", nargs);
else
PyErr_Format(
PyExc_TypeError,