You've already forked python-uncompyle6
mirror of
https://github.com/rocky/python-uncompyle6.git
synced 2025-08-03 00:45:53 +08:00
Fix Python 2.4-2.6 comp_for text generation...
Makefile: tolerate pypy 5.3.x Rest: fix semantic action rule for comp_for and test this
This commit is contained in:
2
Makefile
2
Makefile
@@ -42,7 +42,7 @@ check-2.6:
|
|||||||
|
|
||||||
#:PyPy 2.6.1 or PyPy 5.0.1
|
#:PyPy 2.6.1 or PyPy 5.0.1
|
||||||
# Skip for now
|
# Skip for now
|
||||||
2.6 5.0:
|
2.6 5.0 5.3:
|
||||||
|
|
||||||
#:PyPy pypy3-2.4.0 Python 3:
|
#:PyPy pypy3-2.4.0 Python 3:
|
||||||
pypy-3.2 2.4:
|
pypy-3.2 2.4:
|
||||||
|
BIN
test/bytecode_2.4/04_comp_for.pyc
Normal file
BIN
test/bytecode_2.4/04_comp_for.pyc
Normal file
Binary file not shown.
BIN
test/bytecode_2.6/04_comp_for.pyc
Normal file
BIN
test/bytecode_2.6/04_comp_for.pyc
Normal file
Binary file not shown.
4
test/simple_source/bug26/04_comp_for.py
Normal file
4
test/simple_source/bug26/04_comp_for.py
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
# From python2.6/_abcoll.py
|
||||||
|
# Bug was wrong code for "comp_for" giving
|
||||||
|
# "for in x" instead of: "for x in y"
|
||||||
|
chain = (e for s in (self, other) for x in y)
|
@@ -223,7 +223,6 @@ TABLE_DIRECT = {
|
|||||||
'lc_body': ( '', ), # ignore when recusing
|
'lc_body': ( '', ), # ignore when recusing
|
||||||
|
|
||||||
'comp_iter': ( '%c', 0),
|
'comp_iter': ( '%c', 0),
|
||||||
'comp_for': ( ' for %c in %c%c', 2, 0, 3 ),
|
|
||||||
'comp_if': ( ' if %c%c', 0, 2 ),
|
'comp_if': ( ' if %c%c', 0, 2 ),
|
||||||
'comp_ifnot': ( ' if not %p%c', (0, 22), 2 ),
|
'comp_ifnot': ( ' if not %p%c', (0, 22), 2 ),
|
||||||
'comp_body': ( '', ), # ignore when recusing
|
'comp_body': ( '', ), # ignore when recusing
|
||||||
@@ -596,6 +595,14 @@ class SourceWalker(GenericASTTraversal, object):
|
|||||||
TABLE_DIRECT.update({
|
TABLE_DIRECT.update({
|
||||||
'except_cond3': ( '%|except %c, %c:\n', 1, 6 ),
|
'except_cond3': ( '%|except %c, %c:\n', 1, 6 ),
|
||||||
})
|
})
|
||||||
|
if 2.4 <= version <= 2.6:
|
||||||
|
TABLE_DIRECT.update({
|
||||||
|
'comp_for': ( ' for %c in %c', 3, 1 ),
|
||||||
|
})
|
||||||
|
else:
|
||||||
|
TABLE_DIRECT.update({
|
||||||
|
'comp_for': ( ' for %c in %c%c', 2, 0, 3 ),
|
||||||
|
})
|
||||||
|
|
||||||
|
|
||||||
##########################
|
##########################
|
||||||
|
Reference in New Issue
Block a user