]> granicus.if.org Git - python/commit
bpo-18374: fix wrong col_offset of some ast.BinOp instances (GH-14607)
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Mon, 8 Jul 2019 21:41:34 +0000 (14:41 -0700)
committerGitHub <noreply@github.com>
Mon, 8 Jul 2019 21:41:34 +0000 (14:41 -0700)
commitc7be35c2abd598f02a633879133caec356593241
tree4a1e5b6a7de8e105ef4d2295e63e83b68f167f28
parent54348f46f8c8c023b7e78f9cebe8e54818227b92
bpo-18374: fix wrong col_offset of some ast.BinOp instances (GH-14607)

Nested BinOp instances (e.g. a+b+c) had a wrong col_offset for the
second BinOp (e.g. 2 instead of 0 in the example). Fix it by using the
correct st node to copy the line and col_offset from in ast.c.
(cherry picked from commit 110a47c4f42cf4db88edc1876899fff8f05190fb)

Co-authored-by: Carl Friedrich Bolz-Tereick <cfbolz@gmx.de>
Lib/test/test_ast.py
Misc/ACKS
Misc/NEWS.d/next/Library/2019-07-05-21-46-45.bpo-18374.qgE0H3.rst [new file with mode: 0644]
Python/ast.c