summaryrefslogtreecommitdiffstats
path: root/Parser
diff options
context:
space:
mode:
authorPablo Galindo <Pablogsal@gmail.com>2021-01-03 01:32:43 (GMT)
committerGitHub <noreply@github.com>2021-01-03 01:32:43 (GMT)
commitbfc413ce4fa37ccb889757388102c7755e057bf5 (patch)
tree641735fe8b63a9fb5b744ea8d78ca622ed1fb6d6 /Parser
parent9a608ac17c284008d3c2986a4a8b194f84488e56 (diff)
downloadcpython-bfc413ce4fa37ccb889757388102c7755e057bf5.zip
cpython-bfc413ce4fa37ccb889757388102c7755e057bf5.tar.gz
cpython-bfc413ce4fa37ccb889757388102c7755e057bf5.tar.bz2
[3.9] bpo-42806: Fix ast locations of f-strings inside parentheses (GH-24067) (GH-24069)
(cherry picked from commit bd2728b1e8a99ba8f8c2d481f88aeb99b8b8360f) Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
Diffstat (limited to 'Parser')
-rw-r--r--Parser/pegen/parse_string.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/Parser/pegen/parse_string.c b/Parser/pegen/parse_string.c
index fb0c4af..c852e5b 100644
--- a/Parser/pegen/parse_string.c
+++ b/Parser/pegen/parse_string.c
@@ -410,7 +410,7 @@ fstring_compile_expr(Parser *p, const char *expr_start, const char *expr_end,
Parser *p2 = _PyPegen_Parser_New(tok, Py_fstring_input, p->flags, p->feature_version,
NULL, p->arena);
p2->starting_lineno = t->lineno + lines - 1;
- p2->starting_col_offset = p->tok->first_lineno == p->tok->lineno ? t->col_offset + cols : cols;
+ p2->starting_col_offset = t->col_offset + cols;
expr = _PyPegen_run_parser(p2);