Commit af2b7fb1 authored by Stefan Behnel's avatar Stefan Behnel

move exceptional case out of the way

parent d575f1b3
...@@ -114,12 +114,6 @@ static int __Pyx_PyGen_FetchStopIterationValue(PyObject **pvalue) { ...@@ -114,12 +114,6 @@ static int __Pyx_PyGen_FetchStopIterationValue(PyObject **pvalue) {
return 0; return 0;
} }
if (unlikely(et != PyExc_StopIteration) &&
unlikely(!PyErr_GivenExceptionMatches(et, PyExc_StopIteration))) {
__Pyx_ErrRestore(et, ev, tb);
return -1;
}
// most common case: plain StopIteration without or with separate argument // most common case: plain StopIteration without or with separate argument
if (likely(et == PyExc_StopIteration)) { if (likely(et == PyExc_StopIteration)) {
#if PY_VERSION_HEX >= 0x030300A0 #if PY_VERSION_HEX >= 0x030300A0
...@@ -144,7 +138,11 @@ static int __Pyx_PyGen_FetchStopIterationValue(PyObject **pvalue) { ...@@ -144,7 +138,11 @@ static int __Pyx_PyGen_FetchStopIterationValue(PyObject **pvalue) {
*pvalue = ev; *pvalue = ev;
return 0; return 0;
} }
} else if (!PyErr_GivenExceptionMatches(et, PyExc_StopIteration)) {
__Pyx_ErrRestore(et, ev, tb);
return -1;
} }
// otherwise: normalise and check what that gives us // otherwise: normalise and check what that gives us
PyErr_NormalizeException(&et, &ev, &tb); PyErr_NormalizeException(&et, &ev, &tb);
if (unlikely(!PyObject_IsInstance(ev, PyExc_StopIteration))) { if (unlikely(!PyObject_IsInstance(ev, PyExc_StopIteration))) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment