bpo-36030: Add _PyTuple_FromArray() function (GH-11954)

This commit is contained in:
Sergey Fedoseev 2019-02-25 21:59:12 +05:00 committed by Victor Stinner
parent 55e335d7d5
commit 234531b446
7 changed files with 31 additions and 97 deletions

View file

@ -3831,16 +3831,11 @@ _PyEval_EvalCodeWithName(PyObject *_co, PyObject *globals, PyObject *locals,
/* Pack other positional arguments into the *args argument */
if (co->co_flags & CO_VARARGS) {
u = PyTuple_New(argcount - n);
u = _PyTuple_FromArray(args + n, argcount - n);
if (u == NULL) {
goto fail;
}
SETLOCAL(total_args, u);
for (i = n; i < argcount; i++) {
x = args[i];
Py_INCREF(x);
PyTuple_SET_ITEM(u, i-n, x);
}
}
/* Handle keyword arguments passed as two strided arrays */