From b8ab9d3fc816f85f4d6dbef12b7414e6dc10e4dd Mon Sep 17 00:00:00 2001 From: Yury Selivanov Date: Fri, 6 Oct 2017 02:58:28 -0400 Subject: bpo-31708: Allow async generator expressions in synchronous functions (#3905) --- Python/compile.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Python/compile.c') diff --git a/Python/compile.c b/Python/compile.c index 431e7531e8..58a708ce23 100644 --- a/Python/compile.c +++ b/Python/compile.c @@ -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; -- cgit v1.2.1