You've already forked python-uncompyle6
mirror of
https://github.com/rocky/python-uncompyle6.git
synced 2025-08-03 00:45:53 +08:00
Refine 2.7 control flow reduction tests...
for "iflastsmtl" and "and"
This commit is contained in:
@@ -248,6 +248,8 @@ class Python27Parser(Python2Parser):
|
||||
# an optimization where the "and" jump_false is back to a loop.
|
||||
jmp_false = ast[1]
|
||||
if jmp_false[0] == "POP_JUMP_IF_FALSE":
|
||||
while (first < last and isinstance(tokens[last].offset, str)):
|
||||
last -= 1
|
||||
if jmp_false[0].attr < tokens[last].offset:
|
||||
return True
|
||||
|
||||
@@ -295,7 +297,7 @@ class Python27Parser(Python2Parser):
|
||||
return True
|
||||
while (first < last and isinstance(tokens[last].offset, str)):
|
||||
last -= 1
|
||||
return jmp_false[0].attr < tokens[last].offset
|
||||
return tokens[first].offset < jmp_false[0].attr < tokens[last].offset
|
||||
pass
|
||||
pass
|
||||
pass
|
||||
|
Reference in New Issue
Block a user