Commit 8ad16fc8 authored by Stefan Behnel's avatar Stefan Behnel

Fix another direct usage of "tstate->exc_type" which changed in Py3.7.

Closes #1955.
parent 6bc74386
...@@ -1724,13 +1724,20 @@ static void __Pyx__ReturnWithStopIteration(PyObject* value) { ...@@ -1724,13 +1724,20 @@ static void __Pyx__ReturnWithStopIteration(PyObject* value) {
Py_INCREF(value); Py_INCREF(value);
exc = value; exc = value;
} }
#if CYTHON_FAST_THREAD_STATE
__Pyx_PyThreadState_assign __Pyx_PyThreadState_assign
if (!$local_tstate_cname->exc_type) { #if PY_VERSION_HEX >= 0x030700A2
if (!$local_tstate_cname->exc_state.exc_type)
#else
if (!$local_tstate_cname->exc_type)
#endif
{
// no chaining needed => avoid the overhead in PyErr_SetObject() // no chaining needed => avoid the overhead in PyErr_SetObject()
Py_INCREF(PyExc_StopIteration); Py_INCREF(PyExc_StopIteration);
__Pyx_ErrRestore(PyExc_StopIteration, exc, NULL); __Pyx_ErrRestore(PyExc_StopIteration, exc, NULL);
return; return;
} }
#endif
#else #else
args = PyTuple_Pack(1, value); args = PyTuple_Pack(1, value);
if (unlikely(!args)) return; if (unlikely(!args)) return;
......
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