summaryrefslogtreecommitdiffstats
path: root/Python
diff options
context:
space:
mode:
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>2019-12-14 10:43:42 (GMT)
committerPablo Galindo <Pablogsal@gmail.com>2019-12-14 10:43:42 (GMT)
commitce333cd7d5948b501a988bb56d6a1648e973577c (patch)
tree83d9cd33efcff7c088ed7556583de900f29fff6b /Python
parent4a5db78c9a46a9d151635bc09c7c891069c6bf52 (diff)
downloadcpython-ce333cd7d5948b501a988bb56d6a1648e973577c.zip
cpython-ce333cd7d5948b501a988bb56d6a1648e973577c.tar.gz
cpython-ce333cd7d5948b501a988bb56d6a1648e973577c.tar.bz2
Fix elif start column offset when there is an else following (GH-17596) (GH-17600)
(cherry picked from commit 5936a4ce914d42af97b9238e5090dedc8d5b0bd2) Co-authored-by: Lysandros Nikolaou <lisandrosnik@gmail.com>
Diffstat (limited to 'Python')
-rw-r--r--Python/ast.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/Python/ast.c b/Python/ast.c
index 15d2027..95caeff 100644
--- a/Python/ast.c
+++ b/Python/ast.c
@@ -4053,8 +4053,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--;