summaryrefslogtreecommitdiffstats
path: root/Python
diff options
context:
space:
mode:
authorSergey Fedoseev <fedoseev.sergey@gmail.com>2019-02-25 16:59:12 (GMT)
committerVictor Stinner <vstinner@redhat.com>2019-02-25 16:59:12 (GMT)
commit234531b4462b20d668762bd78406fd2ebab129c9 (patch)
treef0a93cbdf6ebf42055498ea9533891cec0680bcf /Python
parent55e335d7d59be44819c6b672d258e2d5feb1e633 (diff)
downloadcpython-234531b4462b20d668762bd78406fd2ebab129c9.zip
cpython-234531b4462b20d668762bd78406fd2ebab129c9.tar.gz
cpython-234531b4462b20d668762bd78406fd2ebab129c9.tar.bz2
bpo-36030: Add _PyTuple_FromArray() function (GH-11954)
Diffstat (limited to 'Python')
-rw-r--r--Python/ceval.c7
1 files changed, 1 insertions, 6 deletions
diff --git a/Python/ceval.c b/Python/ceval.c
index ff83863..68c1617 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 */