mirror of
https://github.com/python/cpython.git
synced 2025-08-24 18:55:00 +00:00
bpo-45249: Fix caret location when end_offset is set to 0 (GH-28855)
This commit is contained in:
parent
5afa0a4112
commit
fe0d9e22a5
3 changed files with 13 additions and 1 deletions
|
@ -781,7 +781,7 @@ class TracebackException:
|
|||
|
||||
if self.offset is not None:
|
||||
offset = self.offset
|
||||
end_offset = self.end_offset if self.end_offset is not None else offset
|
||||
end_offset = self.end_offset if self.end_offset not in {None, 0} else offset
|
||||
if offset == end_offset or end_offset == -1:
|
||||
end_offset = offset + 1
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue