summaryrefslogtreecommitdiffstats
path: root/Python/ast.c
diff options
context:
space:
mode:
authorLysandros Nikolaou <lisandrosnik@gmail.com>2019-12-14 10:24:57 (GMT)
committerPablo Galindo <Pablogsal@gmail.com>2019-12-14 10:24:57 (GMT)
commit5936a4ce914d42af97b9238e5090dedc8d5b0bd2 (patch)
treeca23be7cf3d6180aab701aeb2be24209865ca284 /Python/ast.c
parent95826c773a9004fc5b3c89de55f800504685ab21 (diff)
downloadcpython-5936a4ce914d42af97b9238e5090dedc8d5b0bd2.zip
cpython-5936a4ce914d42af97b9238e5090dedc8d5b0bd2.tar.gz
cpython-5936a4ce914d42af97b9238e5090dedc8d5b0bd2.tar.bz2
Fix elif start column offset when there is an else following (GH-17596)
Diffstat (limited to 'Python/ast.c')
-rw-r--r--Python/ast.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/Python/ast.c b/Python/ast.c
index c450b87..55fe58c 100644
--- a/Python/ast.c
+++ b/Python/ast.c
@@ -4050,8 +4050,8 @@ ast_for_if_stmt(struct compiling *c, const node *n)
asdl_seq_SET(orelse, 0,
If(expression, suite_seq, suite_seq2,
- LINENO(CHILD(n, NCH(n) - 6)),
- CHILD(n, NCH(n) - 6)->n_col_offset,
+ LINENO(CHILD(n, NCH(n) - 7)),
+ CHILD(n, NCH(n) - 7)->n_col_offset,
end_lineno, end_col_offset, c->c_arena));
/* the just-created orelse handled the last elif */
n_elif--;