summaryrefslogtreecommitdiffstats
path: root/Python/compile.c
diff options
context:
space:
mode:
authorYury Selivanov <yselivanov@sprymix.com>2015-06-22 16:31:24 (GMT)
committerYury Selivanov <yselivanov@sprymix.com>2015-06-22 16:31:24 (GMT)
commit6edc2f75493d0ba5e70c0190f90d162062f879e1 (patch)
tree7c343002b624d90e2d7109e83b56fada93219b48 /Python/compile.c
parent7e3592dca6e9d1f991ef500e9c66c271474907b7 (diff)
parent5376ba9630e45ad177150ae68c9712640330a2fc (diff)
downloadcpython-6edc2f75493d0ba5e70c0190f90d162062f879e1.zip
cpython-6edc2f75493d0ba5e70c0190f90d162062f879e1.tar.gz
cpython-6edc2f75493d0ba5e70c0190f90d162062f879e1.tar.bz2
Issue #24400: Merge 3.5
Diffstat (limited to 'Python/compile.c')
-rw-r--r--Python/compile.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/Python/compile.c b/Python/compile.c
index da16b83..4f11559 100644
--- a/Python/compile.c
+++ b/Python/compile.c
@@ -1064,6 +1064,8 @@ PyCompile_OpcodeStackEffect(int opcode, int oparg)
return 0;
case GET_ANEXT:
return 1;
+ case GET_YIELD_FROM_ITER:
+ return 0;
default:
return PY_INVALID_STACK_EFFECT;
}
@@ -1751,12 +1753,8 @@ compiler_function(struct compiler *c, stmt_ty s, int is_async)
Py_DECREF(qualname);
Py_DECREF(co);
- if (is_async) {
+ if (is_async)
co->co_flags |= CO_COROUTINE;
- /* An async function is always a generator, even
- if there is no 'yield' expressions in it. */
- co->co_flags |= CO_GENERATOR;
- }
/* decorators */
for (i = 0; i < asdl_seq_LEN(decos); i++) {
@@ -3850,7 +3848,7 @@ compiler_visit_expr(struct compiler *c, expr_ty e)
return compiler_error(c, "'yield from' inside async function");
VISIT(c, expr, e->v.YieldFrom.value);
- ADDOP(c, GET_ITER);
+ ADDOP(c, GET_YIELD_FROM_ITER);
ADDOP_O(c, LOAD_CONST, Py_None, consts);
ADDOP(c, YIELD_FROM);
break;