summaryrefslogtreecommitdiffstats
path: root/Python
diff options
context:
space:
mode:
authorYury Selivanov <yury@magic.io>2017-10-06 06:58:28 (GMT)
committerGitHub <noreply@github.com>2017-10-06 06:58:28 (GMT)
commitb8ab9d3fc816f85f4d6dbef12b7414e6dc10e4dd (patch)
tree0baec2d80c9dc9f81b215fafd0074edec43730cb /Python
parentfaa135acbfcd55f79fb97f7525c8aa6f5a5b6a22 (diff)
downloadcpython-b8ab9d3fc816f85f4d6dbef12b7414e6dc10e4dd.zip
cpython-b8ab9d3fc816f85f4d6dbef12b7414e6dc10e4dd.tar.gz
cpython-b8ab9d3fc816f85f4d6dbef12b7414e6dc10e4dd.tar.bz2
bpo-31708: Allow async generator expressions in synchronous functions (#3905)
Diffstat (limited to 'Python')
-rw-r--r--Python/compile.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/Python/compile.c b/Python/compile.c
index 431e753..58a708c 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;