You've already forked python-uncompyle6
mirror of
https://github.com/rocky/python-uncompyle6.git
synced 2025-08-03 08:49:51 +08:00
Scale back "try" vs. "tryelse" reduction test on 3.6+
This commit is contained in:
BIN
test/bytecode_3.6_run/05_try_whiletrue.pyc
Normal file
BIN
test/bytecode_3.6_run/05_try_whiletrue.pyc
Normal file
Binary file not shown.
19
test/simple_source/bug36/05_try_whiletrue.py
Normal file
19
test/simple_source/bug36/05_try_whiletrue.py
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
# From 3.6 _collections.abc.py
|
||||||
|
# Bug was try/execpt parsing detection since 3.6 removes
|
||||||
|
# a JUMP_FORWARD from earlier 3.xs.
|
||||||
|
# This could also get confused with try/else.
|
||||||
|
|
||||||
|
# RUNNABLE!
|
||||||
|
def iter(self):
|
||||||
|
i = 0
|
||||||
|
try:
|
||||||
|
while True:
|
||||||
|
v = self[i]
|
||||||
|
yield v
|
||||||
|
i += 1
|
||||||
|
except IndexError:
|
||||||
|
return
|
||||||
|
|
||||||
|
|
||||||
|
A = [10, 20, 30]
|
||||||
|
assert list(iter(A)) == A
|
@@ -1155,7 +1155,9 @@ class Python3Parser(PythonParser):
|
|||||||
self.check_reduce['ifelsestmt'] = 'AST'
|
self.check_reduce['ifelsestmt'] = 'AST'
|
||||||
self.check_reduce['annotate_tuple'] = 'noAST'
|
self.check_reduce['annotate_tuple'] = 'noAST'
|
||||||
self.check_reduce['kwarg'] = 'noAST'
|
self.check_reduce['kwarg'] = 'noAST'
|
||||||
self.check_reduce['try_except'] = 'AST'
|
if self.version < 3.6:
|
||||||
|
# 3.6+ can remove a JUMP_FORWARD which messes up our testing here
|
||||||
|
self.check_reduce['try_except'] = 'AST'
|
||||||
|
|
||||||
# FIXME: remove parser errors caused by the below
|
# FIXME: remove parser errors caused by the below
|
||||||
# self.check_reduce['while1elsestmt'] = 'noAST'
|
# self.check_reduce['while1elsestmt'] = 'noAST'
|
||||||
|
Reference in New Issue
Block a user