mirror of
https://github.com/python/cpython.git
synced 2025-07-24 11:44:31 +00:00
Merge 3.5 (Issue #24528)
This commit is contained in:
commit
3bd2b98c29
2 changed files with 14 additions and 1 deletions
|
@ -3856,7 +3856,10 @@ compiler_visit_expr(struct compiler *c, expr_ty e)
|
|||
if (c->u->u_ste->ste_type != FunctionBlock)
|
||||
return compiler_error(c, "'await' outside function");
|
||||
|
||||
/* this check won't be triggered while we have AWAIT token */
|
||||
if (c->u->u_scope_type == COMPILER_SCOPE_COMPREHENSION)
|
||||
return compiler_error(
|
||||
c, "'await' expressions in comprehensions are not supported");
|
||||
|
||||
if (c->u->u_scope_type != COMPILER_SCOPE_ASYNC_FUNCTION)
|
||||
return compiler_error(c, "'await' outside async function");
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue