You've already forked python-uncompyle6
mirror of
https://github.com/rocky/python-uncompyle6.git
synced 2025-08-03 00:45:53 +08:00
Go over 2.5 for reduction rules and tests
This commit is contained in:
@@ -34,7 +34,7 @@ case $PYVERSION in
|
||||
SKIP_TESTS=(
|
||||
[test_decimal.py]=1 #
|
||||
[test_dis.py]=1 # We change line numbers - duh!
|
||||
[test_generators.py]=1 # Investigate - botched if/elif control flow badly
|
||||
[test_generators.py]=1 # Investigate
|
||||
[test_grammar.py]=1 # Too many stmts. Handle large stmts
|
||||
[test_grp.py]=1 # Long test - might work Control flow?
|
||||
[test_pep247.py]=1 # Long test - might work? Control flow?
|
||||
@@ -48,37 +48,46 @@ case $PYVERSION in
|
||||
;;
|
||||
2.5)
|
||||
SKIP_TESTS=(
|
||||
[test_coercion.py]=1
|
||||
[test_decimal.py]=1
|
||||
[test_dis.py]=1 # We change line numbers - duh!
|
||||
[test_generators.py]=1 # Investigate
|
||||
[test_grammar.py]=1 # Too many stmts. Handle large stmts
|
||||
[test_grp.py]=1 # Long test - might work Control flow?
|
||||
[test_pdb.py]=1 # Line-number specific
|
||||
[test_pep247.py]=1 # "assert xxx or .." not detected properly in check_hash_module()
|
||||
[test_pep352.py]=1 # Investigate
|
||||
[test_pwd.py]=1 # Long test - might work? Control flow?
|
||||
[test_pyclbr.py]=1 # Investigate
|
||||
[test_queue.py]=1 # Control flow?
|
||||
[test_re.py]=1 # Possibly try confused with try-else again
|
||||
[test_socketserver.py]=1 # Too long to run - 42 seconds
|
||||
[test_struct.py]=1 # "if and" confused for if .. assert and
|
||||
[test_sys.py]=1 # try confused with try-else again; in test_current_frames()
|
||||
[test_tarfile.py]=1 # try confused with try-else again; top-level import
|
||||
[test_threading.py]=1 # test takes too long to run: 11 seconds
|
||||
[test_thread.py]=1 # test takes too long to run: 36 seconds
|
||||
[test_trace.py]=1 # Line numbers are expected to be different
|
||||
[test_urllib2net.py]=1 # is interactive?
|
||||
[test_zipfile64.py]=1 # Runs ok but takes 204 seconds
|
||||
)
|
||||
;;
|
||||
2.6)
|
||||
SKIP_TESTS=(
|
||||
[test_aepack.py]=1 # Fails on its own
|
||||
[test_cmath.py]=1 # Investigate: probably fixable like in later versions
|
||||
[test_coercion.py]=1
|
||||
[test_codeccallbacks.py]=1 # Fails on its own
|
||||
[test_compile.py]=1 # Intermittent - sometimes works and sometimes doesn't
|
||||
[test_dis.py]=1 # We change line numbers - duh!
|
||||
[test_exceptions.py]=1
|
||||
[test_float.py]=1 # Investigate: probably fixable like in later versions
|
||||
[test_generators.py]=1 # Investigate
|
||||
[test_grp.py]=1 # Long test - might work Control flow?
|
||||
[test_itertools.py]=1 # complex numbers. Fix as we do in later versions
|
||||
[test_math.py]=1 # Probably fixable like later versions
|
||||
[test_pep352.py]=1 # Investigate
|
||||
[test_pprint.py]=1
|
||||
[test_pyclbr.py]=1 # Investigate
|
||||
[test_pwd.py]=1 # Long test - might work? Control flow?
|
||||
[test_trace.py]=1 # Line numbers are expected to be different
|
||||
[test_types.py]=1 # Probably fixable like later versions
|
||||
[test_urllib2net.py]=1 # Fails on its own. May need interactive input
|
||||
[test_zipfile64.py]=1 # Skip Long test
|
||||
[test_zlib.py]=1 # Takes too long to run (more than 3 minutes 39 seconds)
|
||||
|
@@ -707,12 +707,14 @@ class Python2Parser(PythonParser):
|
||||
pass
|
||||
pass
|
||||
elif rule == ("ifstmt", ("testexpr", "_ifstmts_jump")):
|
||||
for i in range(last-1, last-4, -1):
|
||||
t = tokens[i]
|
||||
if t == "JUMP_FORWARD":
|
||||
return t.attr > tokens[min(last, len(tokens)-1)].off2int()
|
||||
elif t not in ("POP_TOP", "COME_FROM"):
|
||||
break
|
||||
# FIXME: move this into 2.7-specific code?
|
||||
if self.version == 2.7:
|
||||
for i in range(last-1, last-4, -1):
|
||||
t = tokens[i]
|
||||
if t == "JUMP_FORWARD":
|
||||
return t.attr > tokens[min(last, len(tokens)-1)].off2int()
|
||||
elif t not in ("POP_TOP", "COME_FROM"):
|
||||
break
|
||||
pass
|
||||
elif lhs in ("raise_stmt1",):
|
||||
# We will assume 'LOAD_ASSERT' will be handled by an assert grammar rule
|
||||
@@ -736,9 +738,12 @@ class Python2Parser(PythonParser):
|
||||
# ti will be invalid here.
|
||||
if come_from == "COME_FROM":
|
||||
first_come_from = except_handler[-1]
|
||||
elif come_from == "END_FINALLY":
|
||||
return False
|
||||
else:
|
||||
assert come_from == "come_froms"
|
||||
first_come_from = come_from[0]
|
||||
|
||||
leading_jump = except_handler[0]
|
||||
|
||||
# We really don't care that this is a jump per-se. But
|
||||
|
Reference in New Issue
Block a user