summaryrefslogtreecommitdiff
path: root/Objects/iterobject.c
diff options
context:
space:
mode:
Diffstat (limited to 'Objects/iterobject.c')
-rw-r--r--Objects/iterobject.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/Objects/iterobject.c b/Objects/iterobject.c
index 4dc225a521..2e1caae543 100644
--- a/Objects/iterobject.c
+++ b/Objects/iterobject.c
@@ -163,7 +163,12 @@ static PyObject *
calliter_iternext(calliterobject *it)
{
if (it->it_callable != NULL) {
- PyObject *result = PyObject_CallObject(it->it_callable, NULL);
+ PyObject *args = PyTuple_New(0);
+ PyObject *result;
+ if (args == NULL)
+ return NULL;
+ result = PyObject_Call(it->it_callable, args, NULL);
+ Py_DECREF(args);
if (result != NULL) {
int ok;
ok = PyObject_RichCompareBool(result,