Tolerate bytecode < 1.5

This commit is contained in:
rocky
2018-05-19 11:49:42 -04:00
parent a9515c7aab
commit 94251cd294

View File

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