mirror of
https://github.com/python/cpython.git
synced 2025-12-31 04:23:37 +00:00
bpo-37207: Add _PyArg_NoKwnames() helper function (GH-18980)
This commit is contained in:
parent
c98f87fc33
commit
87ec86c425
5 changed files with 24 additions and 5 deletions
|
|
@ -146,8 +146,7 @@ range_vectorcall(PyTypeObject *type, PyObject *const *args,
|
|||
size_t nargsf, PyObject *kwnames)
|
||||
{
|
||||
Py_ssize_t nargs = PyVectorcall_NARGS(nargsf);
|
||||
if (kwnames && PyTuple_GET_SIZE(kwnames) != 0) {
|
||||
PyErr_Format(PyExc_TypeError, "range() takes no keyword arguments");
|
||||
if (!_PyArg_NoKwnames("range", kwnames)) {
|
||||
return NULL;
|
||||
}
|
||||
return range_from_array(type, args, nargs);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue