diff options
author | Stefan Behnel <stefan_ml@behnel.de> | 2017-11-03 23:36:48 +0100 |
---|---|---|
committer | Stefan Behnel <stefan_ml@behnel.de> | 2017-11-03 23:36:48 +0100 |
commit | 8ad16fc871be075f889d5e7c2892db3e4c8ce978 (patch) | |
tree | ecf3b1a86b1688c7a21c8db5807643f30b334949 | |
parent | 6bc74386b6d5198f86eb9509a858717a081e4efa (diff) | |
download | cython-0.27.3.tar.gz |
Fix another direct usage of "tstate->exc_type" which changed in Py3.7.0.27.3
Closes #1955.
-rw-r--r-- | Cython/Utility/Coroutine.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/Cython/Utility/Coroutine.c b/Cython/Utility/Coroutine.c index b8cd077e7..f0cb4e652 100644 --- a/Cython/Utility/Coroutine.c +++ b/Cython/Utility/Coroutine.c @@ -1724,13 +1724,20 @@ static void __Pyx__ReturnWithStopIteration(PyObject* value) { Py_INCREF(value); exc = value; } + #if CYTHON_FAST_THREAD_STATE __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() Py_INCREF(PyExc_StopIteration); __Pyx_ErrRestore(PyExc_StopIteration, exc, NULL); return; } + #endif #else args = PyTuple_Pack(1, value); if (unlikely(!args)) return; |