summaryrefslogtreecommitdiff
path: root/Python/ceval.c
diff options
context:
space:
mode:
Diffstat (limited to 'Python/ceval.c')
-rw-r--r--Python/ceval.c7
1 files changed, 1 insertions, 6 deletions
diff --git a/Python/ceval.c b/Python/ceval.c
index ff8386352b..68c1617c78 100644
--- a/Python/ceval.c
+++ b/Python/ceval.c
@@ -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 */