mirror of
https://github.com/python/cpython.git
synced 2025-08-22 09:45:06 +00:00
bpo-33346: Allow async comprehensions inside implicit async comprehensions (GH-6766)
Co-authored-by: Pablo Galindo <pablogsal@gmail.com>
This commit is contained in:
parent
0ee0a740e1
commit
054e9c84ac
6 changed files with 109 additions and 17 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue