mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
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'.
This commit is contained in:
parent
b83d917faf
commit
95b6acf951
7 changed files with 2561 additions and 2492 deletions
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue