Skip to content

Commit bdc9942

Browse files
committed
Remove redundant line number setting
1 parent afd3b7e commit bdc9942

File tree

1 file changed

+0
-12
lines changed

1 file changed

+0
-12
lines changed

Python/compile.c

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2025,12 +2025,6 @@ compiler_function(struct compiler *c, stmt_ty s, int is_async)
20252025
return 0;
20262026
}
20272027

2028-
// modify first line number for decorated nodes
2029-
if (asdl_seq_LEN(decos)) {
2030-
expr_ty first_decorator = asdl_seq_GET(decos, 0);
2031-
c->u->u_firstlineno = first_decorator->lineno;
2032-
}
2033-
20342028
/* if not -OO mode, add docstring */
20352029
if (c->c_optimize < 2 && s->v.FunctionDef.docstring)
20362030
docstring = s->v.FunctionDef.docstring;
@@ -2096,12 +2090,6 @@ compiler_class(struct compiler *c, stmt_ty s)
20962090
return 0;
20972091
/* this block represents what we do in the new scope */
20982092
{
2099-
// modify first line number for decorated nodes
2100-
if (asdl_seq_LEN(decos)) {
2101-
expr_ty first_decorator = asdl_seq_GET(decos, 0);
2102-
c->u->u_firstlineno = first_decorator->lineno;
2103-
}
2104-
21052093
/* use the class name for name mangling */
21062094
Py_INCREF(s->v.ClassDef.name);
21072095
Py_XSETREF(c->u->u_private, s->v.ClassDef.name);

0 commit comments

Comments
 (0)