From: Victor Stinner Date: Fri, 19 Aug 2016 16:41:02 +0000 (+0200) Subject: slot_tp_iter() now uses fast call X-Git-Tag: v3.6.0b1~646 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=6911267615ab805d555ef2b0a2458feebbc80d6d;p=thirdparty%2FPython%2Fcpython.git slot_tp_iter() now uses fast call Issue #27128: slot_tp_iter() now calls _PyObject_FastCall() to avoid a temporary empty tuple. --- diff --git a/Objects/typeobject.c b/Objects/typeobject.c index 4d259275b4e5..68e4f90ab6bc 100644 --- a/Objects/typeobject.c +++ b/Objects/typeobject.c @@ -6264,16 +6264,13 @@ slot_tp_iter(PyObject *self) Py_TYPE(self)->tp_name); return NULL; } + if (func != NULL) { - PyObject *args; - args = res = PyTuple_New(0); - if (args != NULL) { - res = PyObject_Call(func, args, NULL); - Py_DECREF(args); - } + res = _PyObject_FastCall(func, NULL, 0, NULL); Py_DECREF(func); return res; } + PyErr_Clear(); func = lookup_method(self, &PyId___getitem__); if (func == NULL) {