bpo-31708: Allow async generator expressions in synchronous functions (#3905)

This commit is contained in:
Yury Selivanov 2017-10-06 02:58:28 -04:00 committed by GitHub
parent faa135acbf
commit b8ab9d3fc8
5 changed files with 52 additions and 9 deletions

View file

@ -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;