In Python 2.2- preserve line numbers

This commit is contained in:
rocky
2022-05-03 07:15:18 -04:00
parent e94e9379c0
commit ac862b4566

View File

@@ -224,10 +224,7 @@ class Scanner(object):
# Offset: lineno pairs, only for offsets which start line.
# Locally we use list for more convenient iteration using indices
if self.version > (1, 4):
linestarts = list(self.opc.findlinestarts(code_obj))
else:
linestarts = [[0, 1]]
linestarts = list(self.opc.findlinestarts(code_obj))
self.linestarts = dict(linestarts)
# 'List-map' which shows line number of current op and offset of