Commit 378259f8 authored by Ronan Lamy's avatar Ronan Lamy

Guard call to tp_iternext slot function with CYTHON_USE_TYPE_SLOTS

Fixes a segfault on pypy3 due to the coroutine type missing tp_iternext in 5.8.
parent 6213a172
......@@ -74,7 +74,11 @@ static PyObject* __Pyx__Coroutine_Yield_From_Generic(__pyx_CoroutineObject *gen,
if (__Pyx_Coroutine_CheckExact(source_gen)) {
retval = __Pyx_Generator_Next(source_gen);
} else {
#if CYTHON_USE_TYPE_SLOTS
retval = Py_TYPE(source_gen)->tp_iternext(source_gen);
#else
retval = PyIter_Next(source_gen);
#endif
}
if (retval) {
gen->yieldfrom = source_gen;
......
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