aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--py/_code/code.py1
1 files changed, 1 insertions, 0 deletions
diff --git a/py/_code/code.py b/py/_code/code.py
index e83db25828..48c31f535b 100644
--- a/py/_code/code.py
+++ b/py/_code/code.py
@@ -164,6 +164,7 @@ class TracebackEntry(object):
# if something: # assume this causes a NameError
# # _this_ lines and the one
# below we don't want from entry.getsource()
+ end = min(end, len(source))
for i in range(self.lineno, end):
if source[i].rstrip().endswith(':'):
end = i + 1