summaryrefslogtreecommitdiffstats
path: root/Lib/traceback.py
diff options
context:
space:
mode:
authorFilipe Laíns <lains@riseup.net>2021-07-08 16:28:01 (GMT)
committerGitHub <noreply@github.com>2021-07-08 16:28:01 (GMT)
commit91a8f8c16ca9a7e2466a8241d9b41769ef97d094 (patch)
tree6ba42ea9ec9549291af04943f8c4521e613dfdfe /Lib/traceback.py
parentbbf2fb6c7ae78f40483606f467739a58cd747270 (diff)
downloadcpython-91a8f8c16ca9a7e2466a8241d9b41769ef97d094.zip
cpython-91a8f8c16ca9a7e2466a8241d9b41769ef97d094.tar.gz
cpython-91a8f8c16ca9a7e2466a8241d9b41769ef97d094.tar.bz2
bpo-44446: support lineno being None in traceback.FrameSummary (GH-26781)
As of 088a15c49d99ecb4c3bef93f8f40dd513c6cae3b, lineno is None instead of -1 if there is no line number. Signed-off-by: Filipe Laíns <lains@riseup.net>
Diffstat (limited to 'Lib/traceback.py')
-rw-r--r--Lib/traceback.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/Lib/traceback.py b/Lib/traceback.py
index cf1ba2a..7cb1241 100644
--- a/Lib/traceback.py
+++ b/Lib/traceback.py
@@ -310,6 +310,8 @@ class FrameSummary:
@property
def line(self):
if self._line is None:
+ if self.lineno is None:
+ return None
self._line = linecache.getline(self.filename, self.lineno)
return self._line.strip()