summaryrefslogtreecommitdiffstats
path: root/Lib/traceback.py
diff options
context:
space:
mode:
authorBatuhan Taskaya <batuhan@python.org>2021-07-24 17:50:39 (GMT)
committerGitHub <noreply@github.com>2021-07-24 17:50:39 (GMT)
commit4f5980a4f57dab68b9137304f58bd08891d43d5a (patch)
tree2bb29a0f309794d1ceb270647a3a5b66c908f479 /Lib/traceback.py
parentef8b8535cb3cd705392af9b927d6ff336d98427d (diff)
downloadcpython-4f5980a4f57dab68b9137304f58bd08891d43d5a.zip
cpython-4f5980a4f57dab68b9137304f58bd08891d43d5a.tar.gz
cpython-4f5980a4f57dab68b9137304f58bd08891d43d5a.tar.bz2
bpo-43950: support long lines in traceback.py (GH-27336)
Diffstat (limited to 'Lib/traceback.py')
-rw-r--r--Lib/traceback.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/Lib/traceback.py b/Lib/traceback.py
index ae5775d..15bdb3c 100644
--- a/Lib/traceback.py
+++ b/Lib/traceback.py
@@ -462,7 +462,11 @@ class StackSummary(list):
row.append(' {}\n'.format(frame.line.strip()))
stripped_characters = len(frame._original_line) - len(frame.line.lstrip())
- if frame.end_lineno == frame.lineno and frame.end_colno != 0:
+ if (
+ frame.end_lineno == frame.lineno
+ and frame.colno is not None
+ and frame.end_colno is not None
+ ):
colno = _byte_offset_to_character_offset(frame._original_line, frame.colno)
end_colno = _byte_offset_to_character_offset(frame._original_line, frame.end_colno)