mirror of
https://github.com/python/cpython.git
synced 2025-08-03 16:39:00 +00:00
bpo-31708: Allow async generator expressions in synchronous functions (#3905)
This commit is contained in:
parent
faa135acbf
commit
b8ab9d3fc8
5 changed files with 52 additions and 9 deletions
|
@ -3974,7 +3974,7 @@ compiler_comprehension(struct compiler *c, expr_ty e, int type,
|
|||
|
||||
is_async_generator = c->u->u_ste->ste_coroutine;
|
||||
|
||||
if (is_async_generator && !is_async_function) {
|
||||
if (is_async_generator && !is_async_function && type != COMP_GENEXP) {
|
||||
if (e->lineno > c->u->u_lineno) {
|
||||
c->u->u_lineno = e->lineno;
|
||||
c->u->u_lineno_set = 0;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue