diff options
Diffstat (limited to 'Modules/_elementtree.c')
-rw-r--r-- | Modules/_elementtree.c | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/Modules/_elementtree.c b/Modules/_elementtree.c index b32f2ad..5d124b3 100644 --- a/Modules/_elementtree.c +++ b/Modules/_elementtree.c @@ -819,9 +819,8 @@ LOCAL(PyObject *) deepcopy(PyObject *object, PyObject *memo) { /* do a deep copy of the given object */ - PyObject *args; - PyObject *result; elementtreestate *st; + PyObject *stack[2]; /* Fast paths */ if (object == Py_None || PyUnicode_CheckExact(object)) { @@ -857,12 +856,9 @@ deepcopy(PyObject *object, PyObject *memo) return NULL; } - args = PyTuple_Pack(2, object, memo); - if (!args) - return NULL; - result = PyObject_CallObject(st->deepcopy_obj, args); - Py_DECREF(args); - return result; + stack[0] = object; + stack[1] = memo; + return _PyObject_FastCall(st->deepcopy_obj, stack, 2, NULL); } |