Commit 49473b1c authored by Stefan Behnel's avatar Stefan Behnel

disable generator frame juggeling in PyPy (not currently supported there)

parent 6f1f311f
...@@ -188,6 +188,9 @@ PyObject *__Pyx_Generator_SendEx(__pyx_GeneratorObject *self, PyObject *value) { ...@@ -188,6 +188,9 @@ PyObject *__Pyx_Generator_SendEx(__pyx_GeneratorObject *self, PyObject *value) {
if (value) { if (value) {
#if CYTHON_COMPILING_IN_PYPY
// FIXME: what to do in PyPy?
#else
/* Generators always return to their most recent caller, not /* Generators always return to their most recent caller, not
* necessarily their creator. */ * necessarily their creator. */
if (self->exc_traceback) { if (self->exc_traceback) {
...@@ -199,7 +202,7 @@ PyObject *__Pyx_Generator_SendEx(__pyx_GeneratorObject *self, PyObject *value) { ...@@ -199,7 +202,7 @@ PyObject *__Pyx_Generator_SendEx(__pyx_GeneratorObject *self, PyObject *value) {
assert(f->f_back == NULL); assert(f->f_back == NULL);
f->f_back = tstate->frame; f->f_back = tstate->frame;
} }
#endif
__Pyx_ExceptionSwap(&self->exc_type, &self->exc_value, __Pyx_ExceptionSwap(&self->exc_type, &self->exc_value,
&self->exc_traceback); &self->exc_traceback);
} else { } else {
...@@ -213,6 +216,9 @@ PyObject *__Pyx_Generator_SendEx(__pyx_GeneratorObject *self, PyObject *value) { ...@@ -213,6 +216,9 @@ PyObject *__Pyx_Generator_SendEx(__pyx_GeneratorObject *self, PyObject *value) {
if (retval) { if (retval) {
__Pyx_ExceptionSwap(&self->exc_type, &self->exc_value, __Pyx_ExceptionSwap(&self->exc_type, &self->exc_value,
&self->exc_traceback); &self->exc_traceback);
#if CYTHON_COMPILING_IN_PYPY
// FIXME: what to do in PyPy?
#else
/* Don't keep the reference to f_back any longer than necessary. It /* Don't keep the reference to f_back any longer than necessary. It
* may keep a chain of frames alive or it could create a reference * may keep a chain of frames alive or it could create a reference
* cycle. */ * cycle. */
...@@ -221,6 +227,7 @@ PyObject *__Pyx_Generator_SendEx(__pyx_GeneratorObject *self, PyObject *value) { ...@@ -221,6 +227,7 @@ PyObject *__Pyx_Generator_SendEx(__pyx_GeneratorObject *self, PyObject *value) {
PyFrameObject *f = tb->tb_frame; PyFrameObject *f = tb->tb_frame;
Py_CLEAR(f->f_back); Py_CLEAR(f->f_back);
} }
#endif
} else { } else {
__Pyx_Generator_ExceptionClear(self); __Pyx_Generator_ExceptionClear(self);
} }
......
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