summaryrefslogtreecommitdiffstats
path: root/Python/ceval.c
diff options
context:
space:
mode:
authorTim Peters <tim.peters@gmail.com>2001-05-05 00:14:56 (GMT)
committerTim Peters <tim.peters@gmail.com>2001-05-05 00:14:56 (GMT)
commitf4848dac41689d1f2f8bd224bd935beae9b8df86 (patch)
treec4b33c842f923add9fde5d8e4a4619ab6b0c316b /Python/ceval.c
parent648b4de3d31aab9df142540919accf0cb518e2f3 (diff)
downloadcpython-f4848dac41689d1f2f8bd224bd935beae9b8df86.zip
cpython-f4848dac41689d1f2f8bd224bd935beae9b8df86.tar.gz
cpython-f4848dac41689d1f2f8bd224bd935beae9b8df86.tar.bz2
Make PyIter_Next() a little smarter (wrt its knowledge of iterator
internals) so clients can be a lot dumber (wrt their knowledge).
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 df160f2..0cdd019 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;