Scale back "try" vs. "tryelse" reduction test on 3.6+

This commit is contained in:
rocky
2019-04-18 16:44:37 -04:00
parent 52af2ba32a
commit 0de99e5d44
3 changed files with 22 additions and 1 deletions

View 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