You've already forked python-uncompyle6
mirror of
https://github.com/rocky/python-uncompyle6.git
synced 2025-08-03 00:45:53 +08:00
More 2.6, 2.7 control flow
Todo more COME_FROMs but now need to check targets better. In some cases we're relying on grammar ambiguity to work out right and in 2.7 it doesn't
This commit is contained in:
@@ -617,7 +617,7 @@ class Scanner2(scan.Scanner):
|
||||
'start': jump_back+3,
|
||||
'end': end})
|
||||
elif op == self.opc.SETUP_EXCEPT:
|
||||
start = offset+3
|
||||
start = offset + self.op_size(op)
|
||||
target = self.get_target(offset, op)
|
||||
end = self.restrict_to_parent(target, parent)
|
||||
if target != end:
|
||||
@@ -632,10 +632,17 @@ class Scanner2(scan.Scanner):
|
||||
|
||||
|
||||
end_finally_offset = end
|
||||
setup_except_nest = 0
|
||||
while end_finally_offset < len(self.code):
|
||||
if self.code[end_finally_offset] == self.opc.END_FINALLY:
|
||||
break
|
||||
if setup_except_nest == 0:
|
||||
break
|
||||
else:
|
||||
setup_except_nest -= 1
|
||||
elif self.code[end_finally_offset] == self.opc.SETUP_EXCEPT:
|
||||
setup_except_nest += 1
|
||||
end_finally_offset += self.op_size(code[end_finally_offset])
|
||||
pass
|
||||
|
||||
# Add the except blocks
|
||||
i = end
|
||||
|
Reference in New Issue
Block a user