mirror of
https://github.com/python/cpython.git
synced 2025-07-24 11:44:31 +00:00
bpo-36030: Add _PyTuple_FromArray() function (GH-11954)
This commit is contained in:
parent
55e335d7d5
commit
234531b446
7 changed files with 31 additions and 97 deletions
|
@ -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 */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue