summaryrefslogtreecommitdiff
path: root/Python/ceval.c
diff options
context:
space:
mode:
Diffstat (limited to 'Python/ceval.c')
-rw-r--r--Python/ceval.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/Python/ceval.c b/Python/ceval.c
index df160f2cc3..0cdd0199b9 100644
--- a/Python/ceval.c
+++ b/Python/ceval.c
@@ -1894,11 +1894,9 @@ eval_code2(PyCodeObject *co, PyObject *globals, PyObject *locals,
PUSH(x);
continue;
}
- if (!PyErr_Occurred() ||
- PyErr_ExceptionMatches(
- PyExc_StopIteration))
- {
- x = v = POP();
+ if (!PyErr_Occurred()) {
+ /* iterator ended normally */
+ x = v = POP();
Py_DECREF(v);
JUMPBY(oparg);
continue;