summaryrefslogtreecommitdiffstats
path: root/Python/compile.c
diff options
context:
space:
mode:
authorYury Selivanov <yselivanov@sprymix.com>2015-06-30 16:49:18 (GMT)
committerYury Selivanov <yselivanov@sprymix.com>2015-06-30 16:49:18 (GMT)
commit3bd2b98c29c1cdc75fd093eb48b3517f1295b50e (patch)
treeb15b9b62fdcd9606e0d84e2e344a1c5fd0e87ba9 /Python/compile.c
parentc28e985f3c9f332369d193afaebc8bf5e90ad079 (diff)
parent9dec03571f2ec588dfc15ff438c85fe25989dcc1 (diff)
downloadcpython-3bd2b98c29c1cdc75fd093eb48b3517f1295b50e.zip
cpython-3bd2b98c29c1cdc75fd093eb48b3517f1295b50e.tar.gz
cpython-3bd2b98c29c1cdc75fd093eb48b3517f1295b50e.tar.bz2
Merge 3.5 (Issue #24528)
Diffstat (limited to 'Python/compile.c')
-rw-r--r--Python/compile.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/Python/compile.c b/Python/compile.c
index 4f11559..ce2b8d6 100644
--- a/Python/compile.c
+++ b/Python/compile.c
@@ -3856,7 +3856,10 @@ compiler_visit_expr(struct compiler *c, expr_ty e)
if (c->u->u_ste->ste_type != FunctionBlock)
return compiler_error(c, "'await' outside function");
- /* this check won't be triggered while we have AWAIT token */
+ if (c->u->u_scope_type == COMPILER_SCOPE_COMPREHENSION)
+ return compiler_error(
+ c, "'await' expressions in comprehensions are not supported");
+
if (c->u->u_scope_type != COMPILER_SCOPE_ASYNC_FUNCTION)
return compiler_error(c, "'await' outside async function");