bpo-34127: Fix grammar in error message with respect to argument count (GH-8395)

This commit is contained in:
Xtreak 2018-07-23 01:43:26 +05:30 committed by Raymond Hettinger
parent c75c1e0e8a
commit 1426daa4fe
3 changed files with 22 additions and 4 deletions

View file

@ -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,