diff options
Diffstat (limited to 'Python/bytecodes.c')
-rw-r--r-- | Python/bytecodes.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/Python/bytecodes.c b/Python/bytecodes.c index 81b527e8c05..8c52db6ab68 100644 --- a/Python/bytecodes.c +++ b/Python/bytecodes.c @@ -2811,11 +2811,12 @@ dummy_func( } else { /* `iterable` is not a generator. */ - iter = PyStackRef_FromPyObjectSteal(PyObject_GetIter(iterable_o)); + PyObject *iter_o = PyObject_GetIter(iterable_o); DEAD(iterable); - if (PyStackRef_IsNull(iter)) { + if (iter_o == NULL) { ERROR_NO_POP(); } + iter = PyStackRef_FromPyObjectSteal(iter_o); DECREF_INPUTS(); } } |