mirror of
https://github.com/python/cpython.git
synced 2025-08-03 16:39:00 +00:00
bpo-34127: Fix grammar in error message with respect to argument count (GH-8395)
This commit is contained in:
parent
c75c1e0e8a
commit
1426daa4fe
3 changed files with 22 additions and 4 deletions
|
@ -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,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue