summaryrefslogtreecommitdiffstats
path: root/Objects
diff options
context:
space:
mode:
authorDong-hee Na <donghee.na92@gmail.com>2020-03-16 14:04:14 (GMT)
committerGitHub <noreply@github.com>2020-03-16 14:04:14 (GMT)
commitc98f87fc330eb40fbcff627dfc50958785a44f35 (patch)
treeff0e4a920cdabc2de995aaec67f380f6af22371c /Objects
parentf707d94af68a15afc27c1a9da5835f9456259fea (diff)
downloadcpython-c98f87fc330eb40fbcff627dfc50958785a44f35.zip
cpython-c98f87fc330eb40fbcff627dfc50958785a44f35.tar.gz
cpython-c98f87fc330eb40fbcff627dfc50958785a44f35.tar.bz2
bpo-37207: Use _PyArg_CheckPositional() for tuple vectorcall (GH-18986)
Diffstat (limited to 'Objects')
-rw-r--r--Objects/tupleobject.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/Objects/tupleobject.c b/Objects/tupleobject.c
index 839667a..d4165de 100644
--- a/Objects/tupleobject.c
+++ b/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;
}