bpo-30534: Fixed error messages when pass keyword arguments (#1901)

to functions implemented in C that don't support this.

Also unified error messages for functions that don't take positional or keyword
arguments.
This commit is contained in:
Serhiy Storchaka 2017-06-06 18:45:22 +03:00 committed by GitHub
parent 5cefb6cfdd
commit 5eb788bf7f
5 changed files with 116 additions and 45 deletions

View file

@ -1176,7 +1176,7 @@ wrapper_call(wrapperobject *wp, PyObject *args, PyObject *kwds)
if (kwds != NULL && (!PyDict_Check(kwds) || PyDict_GET_SIZE(kwds) != 0)) {
PyErr_Format(PyExc_TypeError,
"wrapper %s doesn't take keyword arguments",
"wrapper %s() takes no keyword arguments",
wp->descr->d_base->name);
return NULL;
}