Commit e3ec8cd8 authored by Stefan Behnel's avatar Stefan Behnel

update PEP 525 implementation to match the code in Py3.6/7 (currently non-functional)

parent 32192948
...@@ -9473,7 +9473,8 @@ class YieldExprNode(ExprNode): ...@@ -9473,7 +9473,8 @@ class YieldExprNode(ExprNode):
code.putln("%s->resume_label = %d;" % ( code.putln("%s->resume_label = %d;" % (
Naming.generator_cname, label_num)) Naming.generator_cname, label_num))
if self.in_async_gen and not self.is_await: if self.in_async_gen and not self.is_await:
code.putln("return __pyx__PyAsyncGenWrapValue(%s);" % Naming.retval_cname) # __Pyx__PyAsyncGenValueWrapperNew() steals a reference to the return value
code.putln("return __Pyx__PyAsyncGenValueWrapperNew(%s);" % Naming.retval_cname)
else: else:
code.putln("return %s;" % Naming.retval_cname) code.putln("return %s;" % Naming.retval_cname)
......
This diff is collapsed.
...@@ -292,7 +292,7 @@ static CYTHON_INLINE PyObject *__Pyx_Coroutine_GetAsyncIter(PyObject *obj) { ...@@ -292,7 +292,7 @@ static CYTHON_INLINE PyObject *__Pyx_Coroutine_GetAsyncIter(PyObject *obj) {
static CYTHON_INLINE PyObject *__Pyx_Coroutine_AsyncIterNext(PyObject *obj) { static CYTHON_INLINE PyObject *__Pyx_Coroutine_AsyncIterNext(PyObject *obj) {
#ifdef __Pyx_AsyncGen_USED #ifdef __Pyx_AsyncGen_USED
if (__Pyx_AsyncGen_CheckExact(obj)) { if (__Pyx_AsyncGen_CheckExact(obj)) {
return __Pyx_AsyncGen_ANext(obj); return __Pyx_async_gen_anext(obj);
} }
#endif #endif
#if CYTHON_USE_ASYNC_SLOTS #if CYTHON_USE_ASYNC_SLOTS
...@@ -927,7 +927,7 @@ static int __Pyx_Coroutine_clear(PyObject *self) { ...@@ -927,7 +927,7 @@ static int __Pyx_Coroutine_clear(PyObject *self) {
Py_CLEAR(gen->exc_traceback); Py_CLEAR(gen->exc_traceback);
#ifdef __Pyx_AsyncGen_USED #ifdef __Pyx_AsyncGen_USED
if (__Pyx_AsyncGen_CheckExact(self)) { if (__Pyx_AsyncGen_CheckExact(self)) {
Py_CLEAR(((__pyx_AsyncGenObject*)gen)->ag_finalizer); Py_CLEAR(((__pyx_PyAsyncGenObject*)gen)->ag_finalizer);
} }
#endif #endif
Py_CLEAR(gen->gi_name); Py_CLEAR(gen->gi_name);
...@@ -1324,7 +1324,7 @@ static void __Pyx_Coroutine_check_and_dealloc(PyObject *self) { ...@@ -1324,7 +1324,7 @@ static void __Pyx_Coroutine_check_and_dealloc(PyObject *self) {
PyObject_GC_Track(self); PyObject_GC_Track(self);
#ifdef __Pyx_AsyncGen_USED #ifdef __Pyx_AsyncGen_USED
} else if (__Pyx_AsyncGen_CheckExact(self)) { } else if (__Pyx_AsyncGen_CheckExact(self)) {
__pyx_AsyncGenObject *agen = (__pyx_AsyncGenObject*)self; __pyx_PyAsyncGenObject *agen = (__pyx_PyAsyncGenObject*)self;
PyObject *finalizer = agen->ag_finalizer; PyObject *finalizer = agen->ag_finalizer;
if (finalizer && !agen->ag_closed) { if (finalizer && !agen->ag_closed) {
/* Save the current exception, if any. */ /* Save the current exception, if any. */
......
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