summaryrefslogtreecommitdiffstats
path: root/Python
diff options
context:
space:
mode:
authorPablo Galindo Salgado <Pablogsal@gmail.com>2023-12-11 12:48:19 (GMT)
committerGitHub <noreply@github.com>2023-12-11 12:48:19 (GMT)
commite4d2fb242a5049ae1a2b80fd56ec2c877a19c12f (patch)
tree09549112add489328743686c0c53a01da83d5b65 /Python
parentf3933d4b98266249841d7ae37a84b2f181b9609d (diff)
downloadcpython-e4d2fb242a5049ae1a2b80fd56ec2c877a19c12f.zip
cpython-e4d2fb242a5049ae1a2b80fd56ec2c877a19c12f.tar.gz
cpython-e4d2fb242a5049ae1a2b80fd56ec2c877a19c12f.tar.bz2
[3.12] gh-112943: Correctly compute end offsets for multiline tokens in the tokenize module (GH-112949) (#112957)
(cherry picked from commit a135a6d2c6d503b186695f01efa7eed65611b04e)
Diffstat (limited to 'Python')
-rw-r--r--Python/Python-tokenize.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/Python/Python-tokenize.c b/Python/Python-tokenize.c
index 1938562..179f71a 100644
--- a/Python/Python-tokenize.c
+++ b/Python/Python-tokenize.c
@@ -224,7 +224,7 @@ tokenizeriter_next(tokenizeriterobject *it)
col_offset = _PyPegen_byte_offset_to_character_offset(line, token.start - line_start);
}
if (token.end != NULL && token.end >= it->tok->line_start) {
- end_col_offset = _PyPegen_byte_offset_to_character_offset(line, token.end - it->tok->line_start);
+ end_col_offset = _PyPegen_byte_offset_to_character_offset_raw(it->tok->line_start, token.end - it->tok->line_start);
}
if (it->tok->tok_extra_tokens) {