diff options
author | Miss Skeleton (bot) <31488909+miss-islington@users.noreply.github.com> | 2019-10-26 14:06:40 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-10-26 14:06:40 (GMT) |
commit | ba3a566328e8df49741059b24a41480e248bf6d7 (patch) | |
tree | e6cbbc3df403f496677bd2aacb1d9fcc06fa9805 /Python | |
parent | cf028b57169499f82b73dd0977fe0bab40778a60 (diff) | |
download | cpython-ba3a566328e8df49741059b24a41480e248bf6d7.zip cpython-ba3a566328e8df49741059b24a41480e248bf6d7.tar.gz cpython-ba3a566328e8df49741059b24a41480e248bf6d7.tar.bz2 |
bpo-38535: Fix positions for AST nodes for calls without arguments in decorators. (GH-16861)
(cherry picked from commit 26ae9f6d3d755734c9f371b9356325afe5764813)
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Diffstat (limited to 'Python')
-rw-r--r-- | Python/ast.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/Python/ast.c b/Python/ast.c index 79a29a6..2031b88 100644 --- a/Python/ast.c +++ b/Python/ast.c @@ -1747,8 +1747,10 @@ ast_for_decorator(struct compiling *c, const node *n) name_expr = NULL; } else if (NCH(n) == 5) { /* Call with no arguments */ - d = Call(name_expr, NULL, NULL, LINENO(n), - n->n_col_offset, n->n_end_lineno, n->n_end_col_offset, c->c_arena); + d = Call(name_expr, NULL, NULL, + name_expr->lineno, name_expr->col_offset, + CHILD(n, 3)->n_end_lineno, CHILD(n, 3)->n_end_col_offset, + c->c_arena); if (!d) return NULL; name_expr = NULL; |