summaryrefslogtreecommitdiff
path: root/Python/ast.c
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2018-10-30 13:16:02 +0200
committerGitHub <noreply@github.com>2018-10-30 13:16:02 +0200
commit95b6acf951fa7f503a3cc5ce7d969d7bcf2f95c9 (patch)
tree8f6c2e5a36ae932599e81ba3a226360ca59b19d7 /Python/ast.c
parentb83d917fafd87e4130f9c7d5209ad2debc7219cd (diff)
downloadcpython-git-95b6acf951fa7f503a3cc5ce7d969d7bcf2f95c9.tar.gz
bpo-34876: Change the lineno of the AST for decorated function and class. (GH-9731)
It was overridden by the lineno of the first decorator. Now it is the lineno of 'def' or 'class'.
Diffstat (limited to 'Python/ast.c')
-rw-r--r--Python/ast.c6
1 files changed, 0 insertions, 6 deletions
diff --git a/Python/ast.c b/Python/ast.c
index 184e33b4b5..d5c7ce6982 100644
--- a/Python/ast.c
+++ b/Python/ast.c
@@ -1659,12 +1659,6 @@ ast_for_decorated(struct compiling *c, const node *n)
} else if (TYPE(CHILD(n, 1)) == async_funcdef) {
thing = ast_for_async_funcdef(c, CHILD(n, 1), decorator_seq);
}
- /* we count the decorators in when talking about the class' or
- * function's line number */
- if (thing) {
- thing->lineno = LINENO(n);
- thing->col_offset = n->n_col_offset;
- }
return thing;
}