summaryrefslogtreecommitdiffstats
path: root/Python/compile.c
diff options
context:
space:
mode:
authorMark Shannon <mark@hotpy.org>2021-06-21 10:47:16 (GMT)
committerGitHub <noreply@github.com>2021-06-21 10:47:16 (GMT)
commit7674c83d81905d6afe989ca3f93f08b7939b057c (patch)
tree397a2f0c9fea36718b234dca740690f3cf164e17 /Python/compile.c
parent553e10498ac2020e9abdb5302c91bfb235925cef (diff)
downloadcpython-7674c83d81905d6afe989ca3f93f08b7939b057c.zip
cpython-7674c83d81905d6afe989ca3f93f08b7939b057c.tar.gz
cpython-7674c83d81905d6afe989ca3f93f08b7939b057c.tar.bz2
bpo-44297: Fix missing line number in generator expressions (GH-26821)
* Make sure that line number is set when entering comprehension scope in compiler. (cherry picked from commit 82e5c28af7049c4f5343c808f172cbe2e145f49b)
Diffstat (limited to 'Python/compile.c')
-rw-r--r--Python/compile.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/Python/compile.c b/Python/compile.c
index 4abc9f0..7dc0492 100644
--- a/Python/compile.c
+++ b/Python/compile.c
@@ -4799,6 +4799,7 @@ compiler_comprehension(struct compiler *c, expr_ty e, int type,
{
goto error;
}
+ SET_LOC(c, e);
is_async_generator = c->u->u_ste->ste_coroutine;