Fix 2.x compatibility

This commit is contained in:
rocky
2020-01-09 01:32:15 -05:00
parent 199fb532bf
commit 30d8830957
2 changed files with 1 additions and 13 deletions

View File

@@ -1,10 +0,0 @@
--- uncompyle6/parsers/reducecheck/ifelsestmt.py
+++ uncompyle6/parsers/reducecheck/ifelsestmt.py
@@ -6,6 +6,7 @@ from uncompyle6.scanners.tok import Token
def ifelsestmt(
self, lhs: str, n: int, rule, ast, tokens: list, first: int, last: int
) -> bool:
+
if (last + 1) < n and tokens[last + 1] == "COME_FROM_LOOP":
# ifelsestmt jumped outside of loop. No good.
return True

View File

@@ -1,8 +1,6 @@
# Copyright (c) 2020 Rocky Bernstein
def ifstmt(
self, lhs, n, rule, ast, tokens: list, first, last
) -> bool:
def ifstmt(self, lhs, n, rule, ast, tokens, first, last):
if lhs == "ifstmtl":
if last == n:
last -= 1