diff options
author | Lysandros Nikolaou <lisandrosnik@gmail.com> | 2020-02-08 00:21:38 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-02-08 00:21:38 (GMT) |
commit | 8b9cebce09cb6919fdb97d8e608288a503681d13 (patch) | |
tree | b96fc9afef32515f66874320c43d6a7516936f38 /Python | |
parent | 97e00b3c52796cb54dd0a50548760579b9cb7b3a (diff) | |
download | cpython-8b9cebce09cb6919fdb97d8e608288a503681d13.zip cpython-8b9cebce09cb6919fdb97d8e608288a503681d13.tar.gz cpython-8b9cebce09cb6919fdb97d8e608288a503681d13.tar.bz2 |
[3.8] bpo-39579: Fix Attribute end_col_offset to point at the current node (GH-18405) (GH-18408)
(cherry picked from commit d2e1098641f98594702ef29049c3c4a3f394786f)
https://bugs.python.org/issue39579
Automerge-Triggered-By: @gvanrossum
Diffstat (limited to 'Python')
-rw-r--r-- | Python/ast.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/Python/ast.c b/Python/ast.c index f3263c1..12f24f2 100644 --- a/Python/ast.c +++ b/Python/ast.c @@ -1715,11 +1715,12 @@ ast_for_dotted_name(struct compiling *c, const node *n) return NULL; for (i = 2; i < NCH(n); i+=2) { - id = NEW_IDENTIFIER(CHILD(n, i)); + const node *child = CHILD(n, i); + id = NEW_IDENTIFIER(child); if (!id) return NULL; e = Attribute(e, id, Load, lineno, col_offset, - n->n_end_lineno, n->n_end_col_offset, c->c_arena); + child->n_end_lineno, child->n_end_col_offset, c->c_arena); if (!e) return NULL; } |