X Tutup
Skip to content

Commit cf4fb3c

Browse files
committed
Merge branch 'master' of github.com:rocky/python-uncompyle6 into ast-format
2 parents 92f20f4 + d4006ab commit cf4fb3c

28 files changed

+1459
-232
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
*.pyc
12
*_dis
23
*~
34
*.pyc
@@ -9,6 +10,7 @@
910
/__pkginfo__.pyc
1011
/dist
1112
/how-to-make-a-release.txt
13+
/nose-*.egg
1214
/tmp
1315
/uncompyle6.egg-info
1416
__pycache__

README.rst

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -84,14 +84,18 @@ for usage help.
8484
Known Bugs/Restrictions
8585
-----------------------
8686

87-
Python 2 deparsing decompiles about the first 140 or so of the Python
88-
2.7.10 and 2.7.11 standard library files and all but less that 10%
89-
verify. So as such, it is probably a little better than uncompyle2.
90-
Other Python 2 versions do worse.
91-
92-
Python 3 deparsing before 3.5 is okay, but even there, more work is needed to
93-
decompile all of its library. Python 3.5 is missing some of new
94-
opcodes and idioms added, but it still often works.
87+
Python 2 deparsing decompiles each and all the Python 2.7.10 and
88+
2.7.11 installed packages I have on my system, more than 90% verify
89+
ok. Some of these failures may be bugs in the verification process. So
90+
as such, it is probably a little better than uncompyle2. Other Python
91+
2 versions do worse.
92+
93+
More than 90% the Python 3.3, and 3.4 Python packages that I have
94+
installed on my system deparse. Python 3.2 fares at a little less than
95+
90%. (Each Python version has about 200 byteocde files). All of the
96+
bytecode deparses also verify. Python is more problematic and is
97+
missing some of new opcodes and idioms added. But it still often
98+
works.
9599

96100
There is lots to do, so please dig in and help.
97101

__pkginfo__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
]}
3838
ftp_url = None
3939
install_requires = ['spark-parser >= 1.2.1',
40-
'xdis >= 1.1.0']
40+
'xdis >= 1.1.1']
4141
license = 'MIT'
4242
mailing_list = 'python-debugger@googlegroups.com'
4343
modname = 'uncompyle6'

test/Makefile

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ check:
2020
$(MAKE) check-$$PYTHON_VERSION
2121

2222
#: Run working tests from Python 2.6 or 2.7
23-
check-2.6 check-2.7: check-bytecode check-2.7-ok
23+
check-2.6 check-2.7: check-bytecode-2 check-bytecode-3 check-2.7-ok
2424

2525
#: Run working tests from Python 3.2
2626
check-3.2: check-bytecode
@@ -41,14 +41,21 @@ check-3.4: check-bytecode check-3.4-ok check-2.7-ok
4141
check-disasm:
4242
$(PYTHON) dis-compare.py
4343

44-
#: Check deparsing bytecode only
44+
#: Check deparsing bytecode 2.x only
4545
check-bytecode-2:
46+
$(PYTHON) test_pythonlib.py --bytecode-2.3 --bytecode-2.5 --bytecode-2.6 --bytecode-2.7
47+
48+
#: Check deparsing bytecode 3.x only
49+
check-bytecode-3:
50+
$(PYTHON) test_pythonlib.py --bytecode-3.2 --bytecode-3.3 --bytecode-3.4 --bytecode-3.5
51+
52+
#: Check deparsing bytecode that works running Python 2 and Python 3
53+
check-bytecode: check-bytecode-3
4654
$(PYTHON) test_pythonlib.py --bytecode-2.5 --bytecode-2.6 --bytecode-2.7
4755

48-
#: Check deparsing bytecode only
49-
check-bytecode:
50-
$(PYTHON) test_pythonlib.py --bytecode-2.5 --bytecode-2.6 --bytecode-2.7 \
51-
--bytecode-3.2 --bytecode-3.3 --bytecode-3.4 --bytecode-3.5
56+
#: Check deparsing Python 2.3
57+
check-bytecode-2.3:
58+
$(PYTHON) test_pythonlib.py --bytecode-2.3
5259

5360
#: Check deparsing Python 2.5
5461
check-bytecode-2.5:

test/bytecode_2.3/00_assign.pyc

193 Bytes
Binary file not shown.

test/bytecode_2.3/00_import.pyc

191 Bytes
Binary file not shown.

test/bytecode_2.3/00_pass.pyc

110 Bytes
Binary file not shown.
138 Bytes
Binary file not shown.
466 Bytes
Binary file not shown.
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# Bug from python2.6/SimpleXMLRPCServer.py
2+
# The problem in 2.6 is handling
3+
4+
# 72 JUMP_ABSOLUTE 17 (to 17)
5+
# 75 POP_TOP
6+
# 76 JUMP_ABSOLUTE 17 (to 17)
7+
8+
# And getting:
9+
# list_for ::= expr _for designator list_iter JUMP_BACK
10+
# list_iter ::= list_if JUMP_BACK
11+
# ^^^^^^^^^ added to 2.6 grammar
12+
# list_iter ::= list_for
13+
14+
15+
def list_public_methods(obj):
16+
return [member for member in dir(obj)
17+
if not member.startswith('_') and
18+
hasattr(getattr(obj, member), '__call__')]

0 commit comments

Comments
 (0)
X Tutup