bpo-37207: Add _PyArg_NoKwnames() helper function (GH-18980)

This commit is contained in:
Dong-hee Na 2020-03-16 23:06:20 +09:00 committed by GitHub
parent c98f87fc33
commit 87ec86c425
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 24 additions and 5 deletions

View file

@ -709,8 +709,7 @@ static PyObject *
tuple_vectorcall(PyObject *type, PyObject * const*args,
size_t nargsf, PyObject *kwnames)
{
if (kwnames && PyTuple_GET_SIZE(kwnames) != 0) {
PyErr_Format(PyExc_TypeError, "tuple() takes no keyword arguments");
if (!_PyArg_NoKwnames("tuple", kwnames)) {
return NULL;
}