diff options
| author | Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com> | 2018-09-11 23:32:52 (GMT) |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2018-09-11 23:32:52 (GMT) |
| commit | 4007e4e207bb6cf934864a9012a14022474e36df (patch) | |
| tree | fc9995b8d36bd4e7ab063b6844bcd1b11a51af47 /Python | |
| parent | d8bc7a666b1309aa5669980e35e7429071f3f7d3 (diff) | |
| download | cpython-4007e4e207bb6cf934864a9012a14022474e36df.zip cpython-4007e4e207bb6cf934864a9012a14022474e36df.tar.gz cpython-4007e4e207bb6cf934864a9012a14022474e36df.tar.bz2 | |
Make sure the line comes from the same node as the col offset. (GH-9189)
Followup to 90fc8980bbcc5c7dcced3627fe172b0bfd193a3b.
<!--
Thanks for your contribution!
Please read this comment in its entirety. It's quite important.
GH- 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.
GH- 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`.
-->
(cherry picked from commit d13e59c1b512069d90efe7ee9b613d3913e79c56)
Co-authored-by: Benjamin Peterson <benjamin@python.org>
Diffstat (limited to 'Python')
| -rw-r--r-- | Python/ast.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/Python/ast.c b/Python/ast.c index 5f710c7..07227c2 100644 --- a/Python/ast.c +++ b/Python/ast.c @@ -1602,7 +1602,7 @@ ast_for_funcdef_impl(struct compiling *c, const node *n0, if (is_async) return AsyncFunctionDef(name, args, body, decorator_seq, returns, - LINENO(n), n0->n_col_offset, c->c_arena); + LINENO(n0), n0->n_col_offset, c->c_arena); else return FunctionDef(name, args, body, decorator_seq, returns, 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) if (is_async) return AsyncFor(target, expression, suite_seq, seq, - LINENO(n), n0->n_col_offset, + LINENO(n0), n0->n_col_offset, c->c_arena); else return For(target, expression, suite_seq, seq, @@ -3895,7 +3895,7 @@ ast_for_with_stmt(struct compiling *c, const node *n0, bool is_async) return NULL; if (is_async) - return AsyncWith(items, body, LINENO(n), n0->n_col_offset, c->c_arena); + return AsyncWith(items, body, LINENO(n0), n0->n_col_offset, c->c_arena); else return With(items, body, LINENO(n), n->n_col_offset, c->c_arena); } |
