Skip to content

Commit d13e59c

Browse files
benjaminpmiss-islington
authored andcommitted
Make sure the line comes from the same node as the col offset. (GH-9189)
Followup to 90fc898. <!-- Thanks for your contribution! Please read this comment in its entirety. It's quite important. # Pull Request title It should be in the following format: ``` bpo-NNNN: Summary of the changes made ``` Where: bpo-NNNN refers to the issue number in the https://bugs.python.org. Most PRs will require an issue number. Trivial changes, like fixing a typo, do not need an issue. # Backport Pull Request title If this is a backport PR (PR made against branches other than `master`), please ensure that the PR title is in the following format: ``` [X.Y] <title from the original PR> (GH-NNNN) ``` Where: [X.Y] is the branch name, e.g. [3.6]. GH-NNNN refers to the PR number from `master`. -->
1 parent 998b806 commit d13e59c

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

Python/ast.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1602,7 +1602,7 @@ ast_for_funcdef_impl(struct compiling *c, const node *n0,
16021602

16031603
if (is_async)
16041604
return AsyncFunctionDef(name, args, body, decorator_seq, returns,
1605-
LINENO(n), n0->n_col_offset, c->c_arena);
1605+
LINENO(n0), n0->n_col_offset, c->c_arena);
16061606
else
16071607
return FunctionDef(name, args, body, decorator_seq, returns,
16081608
LINENO(n), n->n_col_offset, c->c_arena);
@@ -3719,7 +3719,7 @@ ast_for_for_stmt(struct compiling *c, const node *n0, bool is_async)
37193719

37203720
if (is_async)
37213721
return AsyncFor(target, expression, suite_seq, seq,
3722-
LINENO(n), n0->n_col_offset,
3722+
LINENO(n0), n0->n_col_offset,
37233723
c->c_arena);
37243724
else
37253725
return For(target, expression, suite_seq, seq,
@@ -3895,7 +3895,7 @@ ast_for_with_stmt(struct compiling *c, const node *n0, bool is_async)
38953895
return NULL;
38963896

38973897
if (is_async)
3898-
return AsyncWith(items, body, LINENO(n), n0->n_col_offset, c->c_arena);
3898+
return AsyncWith(items, body, LINENO(n0), n0->n_col_offset, c->c_arena);
38993899
else
39003900
return With(items, body, LINENO(n), n->n_col_offset, c->c_arena);
39013901
}

0 commit comments

Comments
 (0)