Skip to content

Commit c98f87f

Browse files
authored
bpo-37207: Use _PyArg_CheckPositional() for tuple vectorcall (GH-18986)
1 parent f707d94 commit c98f87f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Objects/tupleobject.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -713,9 +713,9 @@ tuple_vectorcall(PyObject *type, PyObject * const*args,
713713
PyErr_Format(PyExc_TypeError, "tuple() takes no keyword arguments");
714714
return NULL;
715715
}
716+
716717
Py_ssize_t nargs = PyVectorcall_NARGS(nargsf);
717-
if (nargs > 1) {
718-
PyErr_Format(PyExc_TypeError, "tuple() expected at most 1 argument, got %zd", nargs);
718+
if (!_PyArg_CheckPositional("tuple", nargs, 0, 1)) {
719719
return NULL;
720720
}
721721

0 commit comments

Comments
 (0)