diff options
author | Yury Selivanov <yury@magic.io> | 2017-10-06 02:58:28 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-10-06 02:58:28 -0400 |
commit | b8ab9d3fc816f85f4d6dbef12b7414e6dc10e4dd (patch) | |
tree | 0baec2d80c9dc9f81b215fafd0074edec43730cb /Python/compile.c | |
parent | faa135acbfcd55f79fb97f7525c8aa6f5a5b6a22 (diff) | |
download | cpython-git-b8ab9d3fc816f85f4d6dbef12b7414e6dc10e4dd.tar.gz |
bpo-31708: Allow async generator expressions in synchronous functions (#3905)
Diffstat (limited to 'Python/compile.c')
-rw-r--r-- | Python/compile.c | 2 |
1 files changed, 1 insertions, 1 deletions
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; |