You've already forked python-uncompyle6
mirror of
https://github.com/rocky/python-uncompyle6.git
synced 2025-08-03 08:49:51 +08:00
A 2.6 comprehension bug
This commit is contained in:
BIN
test/bytecode_2.6/06_setif_comprehension.pyc
Normal file
BIN
test/bytecode_2.6/06_setif_comprehension.pyc
Normal file
Binary file not shown.
9
test/simple_source/bug26/06_setif_comprehension.py
Normal file
9
test/simple_source/bug26/06_setif_comprehension.py
Normal 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))
|
@@ -130,6 +130,7 @@ class Python26Parser(Python2Parser):
|
|||||||
# Make sure we keep indices the same as 2.7
|
# Make sure we keep indices the same as 2.7
|
||||||
setup_loop_lf ::= SETUP_LOOP LOAD_FAST
|
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 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):
|
def p_ret26(self, args):
|
||||||
|
Reference in New Issue
Block a user