mirror of
https://github.com/rocky/python-uncompyle6.git
synced 2024-11-23 13:09:49 +00:00
Fix 2.6- parsing of "for .. try/else" ...
with "continue" inside
This commit is contained in:
parent
d66fedb921
commit
abcb769fdf
BIN
test/bytecode_2.6/03_tryelse_continue.pyc
Normal file
BIN
test/bytecode_2.6/03_tryelse_continue.pyc
Normal file
Binary file not shown.
14
test/simple_source/bug26/03_tryelse_continue.py
Normal file
14
test/simple_source/bug26/03_tryelse_continue.py
Normal file
@ -0,0 +1,14 @@
|
||||
# 2.6- Try/else in a loop with a continue which
|
||||
# requires a tryelsestmtc
|
||||
# From 2.6- test_codecs.py
|
||||
def test_specific_values(self):
|
||||
for flags in self:
|
||||
if flags:
|
||||
try:
|
||||
self = 1
|
||||
except ValueError:
|
||||
continue
|
||||
else:
|
||||
self = 2
|
||||
|
||||
self = 3
|
@ -53,18 +53,9 @@ nn [test_zipfile64.py]=1 # Runs ok but takes 204 seconds
|
||||
;;
|
||||
2.6)
|
||||
SKIP_TESTS=(
|
||||
[test_cmath.py]=1 # Control flow?
|
||||
[test_codecs.py]=1 # need to fix tryelse
|
||||
[test_coercion.py]=1 # Control flow?
|
||||
[test_decorators.py]=1 # Syntax Error - look at
|
||||
[test_frozen.py]=1 # Control flow?
|
||||
[test_ftplib.py]=1 # Control flow?
|
||||
[test_grp.py]=1 # Long test - might work Control flow?
|
||||
[test_imp.py]=1
|
||||
[test_pwd.py]=1 # Long test - might work? Control flow?
|
||||
[test_queue.py]=1 # Control flow?
|
||||
[test_re.py]=1 # Probably Control flow?
|
||||
[test_strftime.py]=1
|
||||
[test_trace.py]=1 # Line numbers are expected to be different
|
||||
# .pyenv/versions/2.6.9/lib/python2.6/lib2to3/refactor.pyc
|
||||
# .pyenv/versions/2.6.9/lib/python2.6/mailbox.pyc
|
||||
|
@ -42,6 +42,8 @@ class Python26Parser(Python2Parser):
|
||||
except_handler else_suite come_froms
|
||||
tryelsestmtl ::= SETUP_EXCEPT suite_stmts_opt POP_BLOCK
|
||||
except_handler else_suitel
|
||||
tryelsestmtc ::= SETUP_EXCEPT suite_stmts_opt POP_BLOCK
|
||||
except_handler else_suitec
|
||||
|
||||
_ifstmts_jump ::= c_stmts_opt JUMP_FORWARD COME_FROM POP_TOP
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user