diff options
author | Mark Dickinson <mdickinson@enthought.com> | 2012-11-25 14:36:26 (GMT) |
---|---|---|
committer | Mark Dickinson <mdickinson@enthought.com> | 2012-11-25 14:36:26 (GMT) |
commit | ded35aeb9d5ae1671174f10c0ae8a7166693b17c (patch) | |
tree | 4caa61589581de32b38d3da8ee8bd68e553094bf /Python/symtable.c | |
parent | 9982c53c2feb6e6e03c4c6d87d77c6ee69bfc435 (diff) | |
download | cpython-ded35aeb9d5ae1671174f10c0ae8a7166693b17c.zip cpython-ded35aeb9d5ae1671174f10c0ae8a7166693b17c.tar.gz cpython-ded35aeb9d5ae1671174f10c0ae8a7166693b17c.tar.bz2 |
Issue #16546: make ast.YieldFrom argument mandatory.
Diffstat (limited to 'Python/symtable.c')
-rw-r--r-- | Python/symtable.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/Python/symtable.c b/Python/symtable.c index 9dde908..55898f9 100644 --- a/Python/symtable.c +++ b/Python/symtable.c @@ -1371,14 +1371,14 @@ symtable_visit_expr(struct symtable *st, expr_ty e) VISIT_QUIT(st, 0); break; case Yield_kind: - case YieldFrom_kind: { - expr_ty value; - value = (e->kind == YieldFrom_kind) ? e->v.YieldFrom.value : e->v.Yield.value; - if (value) - VISIT(st, expr, value); + if (e->v.Yield.value) + VISIT(st, expr, e->v.Yield.value); + st->st_cur->ste_generator = 1; + break; + case YieldFrom_kind: + VISIT(st, expr, e->v.YieldFrom.value); st->st_cur->ste_generator = 1; break; - } case Compare_kind: VISIT(st, expr, e->v.Compare.left); VISIT_SEQ(st, expr, e->v.Compare.comparators); |