summaryrefslogtreecommitdiffstats
path: root/Python/symtable.c
diff options
context:
space:
mode:
Diffstat (limited to 'Python/symtable.c')
-rw-r--r--Python/symtable.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/Python/symtable.c b/Python/symtable.c
index 4508464..64c1635 100644
--- a/Python/symtable.c
+++ b/Python/symtable.c
@@ -2056,7 +2056,14 @@ symtable_handle_comprehension(struct symtable *st, expr_ty e,
return 0;
}
st->st_cur->ste_generator = is_generator;
- return symtable_exit_block(st);
+ int is_async = st->st_cur->ste_coroutine && !is_generator;
+ if (!symtable_exit_block(st)) {
+ return 0;
+ }
+ if (is_async) {
+ st->st_cur->ste_coroutine = 1;
+ }
+ return 1;
}
static int