A 2.6 comprehension bug

This commit is contained in:
rocky 2016-06-29 21:24:19 -04:00
parent 1ce1cf87a4
commit 5b2198a4a6
4 changed files with 10 additions and 0 deletions

Binary file not shown.

View File

@ -0,0 +1,9 @@
# From 2.6.9 abc.py
# For 2.6:
# genexpr_func ::= setup_loop_lf FOR_ITER designator comp_iter JUMP_BACK come_from_pop JUMP_BACK POP_BLOCK COME_FROM
# This has been a bug in other Pythons after 2.6 were set comprehension {} is used instead of set().
abstracts = set(name
for name, value in namespace.items()
if getattr(value, "__isabstractmethod__", False))

View File

@ -130,6 +130,7 @@ class Python26Parser(Python2Parser):
# Make sure we keep indices the same as 2.7
setup_loop_lf ::= SETUP_LOOP LOAD_FAST
genexpr_func ::= setup_loop_lf FOR_ITER designator comp_iter JUMP_BACK POP_BLOCK COME_FROM
genexpr_func ::= setup_loop_lf FOR_ITER designator comp_iter JUMP_BACK come_from_pop JUMP_BACK POP_BLOCK COME_FROM
'''
def p_ret26(self, args):