Browse Source

bpo-37207: Use _PyArg_CheckPositional() for tuple vectorcall (GH-18986)

pull/19019/head
Dong-hee Na 6 years ago
committed by GitHub
parent
commit
c98f87fc33
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 4
      Objects/tupleobject.c

4
Objects/tupleobject.c

@ -713,9 +713,9 @@ tuple_vectorcall(PyObject *type, PyObject * const*args,
PyErr_Format(PyExc_TypeError, "tuple() takes no keyword arguments");
return NULL;
}
Py_ssize_t nargs = PyVectorcall_NARGS(nargsf);
if (nargs > 1) {
PyErr_Format(PyExc_TypeError, "tuple() expected at most 1 argument, got %zd", nargs);
if (!_PyArg_CheckPositional("tuple", nargs, 0, 1)) {
return NULL;
}

Loading…
Cancel
Save