summaryrefslogtreecommitdiffstats
path: root/Python/compile.c
diff options
context:
space:
mode:
Diffstat (limited to 'Python/compile.c')
-rw-r--r--Python/compile.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/Python/compile.c b/Python/compile.c
index 849f487..4d91f50 100644
--- a/Python/compile.c
+++ b/Python/compile.c
@@ -840,6 +840,7 @@ opcode_stack_effect(int opcode, int oparg)
case IMPORT_STAR:
return -1;
case YIELD_VALUE:
+ case YIELD_FROM:
return 0;
case POP_BLOCK:
@@ -3318,7 +3319,12 @@ compiler_visit_expr(struct compiler *c, expr_ty e)
else {
ADDOP_O(c, LOAD_CONST, Py_None, consts);
}
- ADDOP(c, YIELD_VALUE);
+ if (e->v.Yield.is_from) {
+ ADDOP(c, YIELD_FROM);
+ }
+ else {
+ ADDOP(c, YIELD_VALUE);
+ }
break;
case Compare_kind:
return compiler_compare(c, e);