code.putln('%s = %s->%s;' % (cname, Naming.cur_scope_cname, save_cname))
if type.is_pyobject:
code.putln('%s->%s = 0;' % (Naming.cur_scope_cname, save_cname))
- code.putln('%s = __pyx_send_value; %s' %
- (self.result(), code.error_goto_if_null(self.result(), self.pos)))
+ code.putln('%s = %s; %s' %
+ (self.result(), Naming.sent_value_cname,
+ code.error_goto_if_null(self.result(), self.pos)))
code.put_incref(self.result(), py_object_type)
class StopIterationNode(Node):
static PyObject *__CyGenerator_Next(PyObject *self);
static PyObject *__CyGenerator_Send(PyObject *self, PyObject *value);
static PyObject *__CyGenerator_Close(PyObject *self);
-typedef PyObject *(*__cygenerator_body_t)(PyObject *, PyObject *, int);
+typedef PyObject *(*__cygenerator_body_t)(PyObject *, PyObject *);
""",
impl="""
-static CYTHON_INLINE PyObject *__CyGenerator_SendEx(struct __CyGenerator *self, PyObject *value, int is_exc)
+static CYTHON_INLINE PyObject *__CyGenerator_SendEx(struct __CyGenerator *self, PyObject *value)
{
PyObject *retval;
}
self->is_running = 1;
- retval = self->body((PyObject *) self, value, is_exc);
+ retval = self->body((PyObject *) self, value);
self->is_running = 0;
return retval;
PyObject *retval;
Py_INCREF(Py_None);
- retval = __CyGenerator_SendEx(generator, Py_None, 0);
+ retval = __CyGenerator_SendEx(generator, Py_None);
Py_DECREF(Py_None);
return retval;
}
static PyObject *__CyGenerator_Send(PyObject *self, PyObject *value)
{
- return __CyGenerator_SendEx((struct __CyGenerator *) self, value, 0);
+ return __CyGenerator_SendEx((struct __CyGenerator *) self, value);
}
static PyObject *__CyGenerator_Close(PyObject *self)
struct __CyGenerator *generator = (struct __CyGenerator *) self;
PyObject *retval;
PyErr_SetNone(PyExc_GeneratorExit);
- retval = __CyGenerator_SendEx(generator, NULL, 0);
+ retval = __CyGenerator_SendEx(generator, NULL);
if (retval) {
Py_DECREF(retval);
PyErr_SetString(PyExc_RuntimeError,
code.use_label(first_run_label)
code.put_label(first_run_label)
code.putln('%s' %
- (code.error_goto_if_null('__pyx_send_value', self.pos)))
+ (code.error_goto_if_null(Naming.sent_value_cname, self.pos)))
if not self.is_generator:
self.generate_argument_parsing_code(env, code)
# If an argument is assigned to in the body, we must
self.entry.pymethdef_cname)
code.put_pymethoddef(self.entry, ";", allow_skip=False)
if self.is_generator:
- code.putln("static PyObject *%s(PyObject *%s, PyObject *__pyx_send_value, int __pyx_is_exc) /* generator body */\n{" %
- (self.generator_body_cname, Naming.self_cname))
+ code.putln("static PyObject *%s(PyObject *%s, PyObject *%s) /* generator body */\n{" %
+ (self.generator_body_cname, Naming.self_cname, Naming.sent_value_cname))
self.generator = GeneratorWrapperNode(self,
func_cname=self.entry.func_cname,
body_cname=self.generator_body_cname,