You've already forked python-uncompyle6
mirror of
https://github.com/rocky/python-uncompyle6.git
synced 2025-08-04 01:09:52 +08:00
<= 2.6 weird jump out of try block
Allow COME_FROMs to appare via JUMP_FORWARD in tey/except blocks
This commit is contained in:
BIN
test/bytecode_2.6/07_try_pass.pyc
Normal file
BIN
test/bytecode_2.6/07_try_pass.pyc
Normal file
Binary file not shown.
9
test/simple_source/exception/07_try_pass.py
Normal file
9
test/simple_source/exception/07_try_pass.py
Normal file
@@ -0,0 +1,9 @@
|
||||
# 2.6.9 cgi.py
|
||||
# Bug in 2.6.9 was not detecting jump out of except from ValueError
|
||||
def __getitem__(v):
|
||||
if v:
|
||||
try: return v
|
||||
except ValueError:
|
||||
try: return v
|
||||
except ValueError: pass
|
||||
return v
|
@@ -502,9 +502,13 @@ class Scanner2(scan.Scanner):
|
||||
'end': jmp+1})
|
||||
i = jmp + 1
|
||||
else:
|
||||
if self.get_target(jmp) != start_else:
|
||||
target = self.get_target(jmp)
|
||||
if target != start_else:
|
||||
end_else = self.get_target(jmp)
|
||||
if self.code[jmp] == self.opc.JF:
|
||||
if self.version <= 2.6:
|
||||
self.fixed_jumps[jmp] = target
|
||||
else:
|
||||
self.fixed_jumps[jmp] = -1
|
||||
self.structs.append({'type': 'except',
|
||||
'start': i,
|
||||
|
Reference in New Issue
Block a user