summaryrefslogtreecommitdiffstats
path: root/Lib/traceback.py
diff options
context:
space:
mode:
authorPablo Galindo Salgado <Pablogsal@gmail.com>2021-10-16 17:27:43 (GMT)
committerGitHub <noreply@github.com>2021-10-16 17:27:43 (GMT)
commitfe0d9e22a52a10c4cbe52254b51f2d4e74d83568 (patch)
tree164d8d69ef92ef996cf43c4f4ae8ffeafc3980f7 /Lib/traceback.py
parent5afa0a411243210a30526c7459a0ccff5cb88494 (diff)
downloadcpython-fe0d9e22a52a10c4cbe52254b51f2d4e74d83568.zip
cpython-fe0d9e22a52a10c4cbe52254b51f2d4e74d83568.tar.gz
cpython-fe0d9e22a52a10c4cbe52254b51f2d4e74d83568.tar.bz2
bpo-45249: Fix caret location when end_offset is set to 0 (GH-28855)
Diffstat (limited to 'Lib/traceback.py')
-rw-r--r--Lib/traceback.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/Lib/traceback.py b/Lib/traceback.py
index 3cb8e57..568f3ff 100644
--- a/Lib/traceback.py
+++ b/Lib/traceback.py
@@ -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