mirror of
https://github.com/python/cpython.git
synced 2025-09-10 10:47:34 +00:00
bpo-39562: Allow executing asynchronous comprehensions in the asyncio REPL (GH-18968)
Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
This commit is contained in:
parent
0ac59f93c0
commit
9052f7a41b
3 changed files with 15 additions and 3 deletions
|
@ -4520,11 +4520,14 @@ compiler_comprehension(struct compiler *c, expr_ty e, int type,
|
|||
PyCodeObject *co = NULL;
|
||||
comprehension_ty outermost;
|
||||
PyObject *qualname = NULL;
|
||||
int is_async_function = c->u->u_ste->ste_coroutine;
|
||||
int is_async_generator = 0;
|
||||
|
||||
outermost = (comprehension_ty) asdl_seq_GET(generators, 0);
|
||||
if (IS_TOP_LEVEL_AWAIT(c)) {
|
||||
c->u->u_ste->ste_coroutine = 1;
|
||||
}
|
||||
int is_async_function = c->u->u_ste->ste_coroutine;
|
||||
|
||||
outermost = (comprehension_ty) asdl_seq_GET(generators, 0);
|
||||
if (!compiler_enter_scope(c, name, COMPILER_SCOPE_COMPREHENSION,
|
||||
(void *)e, e->lineno))
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue