summaryrefslogtreecommitdiffstats
path: root/Python/symtable.c
diff options
context:
space:
mode:
authorYury Selivanov <yury@magic.io>2016-09-09 17:36:01 (GMT)
committerYury Selivanov <yury@magic.io>2016-09-09 17:36:01 (GMT)
commit52c4e7cc84702750bb75d5423da01d01bcdfdf39 (patch)
tree01ebfe1725b4169baefa4e76aeaeffcd25153f3b /Python/symtable.c
parent93b2dee80e5d72cf12522d773b512097493c09fc (diff)
downloadcpython-52c4e7cc84702750bb75d5423da01d01bcdfdf39.zip
cpython-52c4e7cc84702750bb75d5423da01d01bcdfdf39.tar.gz
cpython-52c4e7cc84702750bb75d5423da01d01bcdfdf39.tar.bz2
Issue #28008: Implement PEP 530 -- asynchronous comprehensions.
Diffstat (limited to 'Python/symtable.c')
-rw-r--r--Python/symtable.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/Python/symtable.c b/Python/symtable.c
index 9325dc1..f762904 100644
--- a/Python/symtable.c
+++ b/Python/symtable.c
@@ -1682,6 +1682,9 @@ symtable_visit_comprehension(struct symtable *st, comprehension_ty lc)
VISIT(st, expr, lc->target);
VISIT(st, expr, lc->iter);
VISIT_SEQ(st, expr, lc->ifs);
+ if (lc->is_async) {
+ st->st_cur->ste_coroutine = 1;
+ }
return 1;
}
@@ -1734,6 +1737,9 @@ symtable_handle_comprehension(struct symtable *st, expr_ty e,
return 0;
}
st->st_cur->ste_generator = is_generator;
+ if (outermost->is_async) {
+ st->st_cur->ste_coroutine = 1;
+ }
/* Outermost iter is received as an argument */
if (!symtable_implicit_arg(st, 0)) {
symtable_exit_block(st, (void *)e);