You've already forked python-uncompyle6
mirror of
https://github.com/rocky/python-uncompyle6.git
synced 2025-08-03 16:59:52 +08:00
Compare commits
586 Commits
release-py
...
release-py
Author | SHA1 | Date | |
---|---|---|---|
|
1462a8beb0 | ||
|
f877e65919 | ||
|
155031a7c4 | ||
|
c81b40b43b | ||
|
78898ed187 | ||
|
ef03d78c4d | ||
|
7fc7e083c3 | ||
|
d41a858f80 | ||
|
6dd0ad0810 | ||
|
9368b63a2f | ||
|
da06d83a87 | ||
|
6fb5808ff0 | ||
|
0c3db340fa | ||
|
925b6667d7 | ||
|
b8547346b7 | ||
|
0aa7a7c223 | ||
|
cf5445c202 | ||
|
bc8c38ee58 | ||
|
4cd81dab61 | ||
|
4f4b628842 | ||
|
ff50a7f37b | ||
|
85a49aec2f | ||
|
9f2c7352e7 | ||
|
e9cf370e11 | ||
|
90ac8a463d | ||
|
0e64111195 | ||
|
fd84325e4f | ||
|
ddc00edd42 | ||
|
4259963859 | ||
|
4905cc6bb0 | ||
|
f008b8f411 | ||
|
2e81ee5d2e | ||
|
50e59a37c1 | ||
|
5c8f93b735 | ||
|
88ef4baca8 | ||
|
6ab711baab | ||
|
9e05750537 | ||
|
5c662b334e | ||
|
56b2e17e30 | ||
|
94038151f4 | ||
|
b9281c79be | ||
|
51dec051df | ||
|
f5ac06013f | ||
|
06bbacef45 | ||
|
bfdc6529a0 | ||
|
1ed389ce61 | ||
|
19f2e1277b | ||
|
48b251273a | ||
|
6290311143 | ||
|
947d619c77 | ||
|
908d313204 | ||
|
38dffa3290 | ||
|
c8747cc899 | ||
|
8a705a70f5 | ||
|
92d562e600 | ||
|
c91b5e1164 | ||
|
f8fd474b55 | ||
|
30756c52b2 | ||
|
74e280171b | ||
|
df0207eb90 | ||
|
07a8ae9541 | ||
|
5d6872bcd1 | ||
|
c03cdf1a49 | ||
|
01ad91b519 | ||
|
ccd42077c1 | ||
|
ca3f822c81 | ||
|
bc5f43ab05 | ||
|
1896c40202 | ||
|
8278c72a6f | ||
|
3b0a5aab16 | ||
|
a74890d388 | ||
|
5d24367ef6 | ||
|
1da2118e13 | ||
|
cad1325a90 | ||
|
61534ceed5 | ||
|
9f66694056 | ||
|
2bdfd76635 | ||
|
01f2f6578b | ||
|
67e8f5d1a7 | ||
|
02b1554da3 | ||
|
fac5d31f34 | ||
|
d42858cae4 | ||
|
2a76013ed5 | ||
|
9e815d8d79 | ||
|
def9e1676b | ||
|
35fcb1edf1 | ||
|
ffbce9cb77 | ||
|
dc1971f559 | ||
|
cef61904c7 | ||
|
778f92b6f4 | ||
|
a8260edded | ||
|
c662cb1df2 | ||
|
681bbd616b | ||
|
e809ade6e1 | ||
|
d080b4402d | ||
|
46390a161e | ||
|
7200d298a5 | ||
|
28d0ec7a2a | ||
|
bb13988126 | ||
|
8d503682b3 | ||
|
26e1df835c | ||
|
6807015526 | ||
|
99d9beac76 | ||
|
452d17a6c3 | ||
|
8a842c57d3 | ||
|
8d1c454376 | ||
|
fb333f1505 | ||
|
2edc757b6f | ||
|
ef076c065b | ||
|
a0e3759f76 | ||
|
f7439f506a | ||
|
257c3ca454 | ||
|
e23315b2e6 | ||
|
413df51dfa | ||
|
1fe432585e | ||
|
b128e4fde6 | ||
|
7eb19a8617 | ||
|
ab257dc7ce | ||
|
b6d96929cb | ||
|
68692abaf6 | ||
|
55a10d9e20 | ||
|
e9d1b86a5b | ||
|
e3d8751338 | ||
|
a1532bbfea | ||
|
afb90dd12e | ||
|
c43c9a19aa | ||
|
d3f5ec6f30 | ||
|
5c2d0484e5 | ||
|
31de0d2af5 | ||
|
195075ac01 | ||
|
d09e820d89 | ||
|
b584a0f6b0 | ||
|
df7cfa2d20 | ||
|
7f3956c996 | ||
|
98394d18bb | ||
|
493835b8cd | ||
|
f6aa775d58 | ||
|
2f6a85d538 | ||
|
8c0f256b78 | ||
|
6e2ca8f53d | ||
|
c1ed6dea62 | ||
|
ab1c2ec5bb | ||
|
e3d0b1b9ce | ||
|
aaf83ea35d | ||
|
cb24973147 | ||
|
3545c7dc6f | ||
|
8463221527 | ||
|
128963d2e9 | ||
|
1cb9fc8b43 | ||
|
6b6a085b08 | ||
|
b9147b7872 | ||
|
5496271000 | ||
|
30fbdff29c | ||
|
26e65e0d90 | ||
|
16b5df4ba4 | ||
|
fee6114d74 | ||
|
a2b6ebc669 | ||
|
09efb24a3e | ||
|
a1b2a91d88 | ||
|
b14655dd43 | ||
|
3de2890050 | ||
|
859ce2206d | ||
|
90ae3e42f6 | ||
|
ee89b5decd | ||
|
158a1886fe | ||
|
d2285f0d61 | ||
|
2e44ac25a1 | ||
|
8864034966 | ||
|
deb9903a97 | ||
|
f4b7e54313 | ||
|
08c7966ef9 | ||
|
9d425039a2 | ||
|
a5c388c13b | ||
|
c82095e6ac | ||
|
67ad08fd4a | ||
|
fa4f614295 | ||
|
832f04a486 | ||
|
f7f0aa5ea9 | ||
|
083ae5f3fd | ||
|
657d5ef024 | ||
|
e92c2503d1 | ||
|
a01091a46e | ||
|
b5a825f4d8 | ||
|
730b0549d5 | ||
|
e431e49d77 | ||
|
230a38d537 | ||
|
6d29ed9077 | ||
|
bb45be2dc7 | ||
|
f7999d2754 | ||
|
5aeb0424fc | ||
|
b74662cf3d | ||
|
d4dea7751b | ||
|
50e9a9102b | ||
|
a8051f049f | ||
|
4cbba3d46e | ||
|
296fcd89ce | ||
|
ca2c06ca87 | ||
|
be03b22d32 | ||
|
9dfd495bfa | ||
|
576ab98319 | ||
|
555a1235b2 | ||
|
ed3b0e81b9 | ||
|
75755c8cfc | ||
|
a753e2c08f | ||
|
c433d2d9a7 | ||
|
a8fe985ed3 | ||
|
0a12dfb422 | ||
|
9d852b48aa | ||
|
4ce769399f | ||
|
d0dfdcfcde | ||
|
4e949a798d | ||
|
a5526d704a | ||
|
8d3bee6c8e | ||
|
bcf437deda | ||
|
1a018cd3ea | ||
|
e371956c72 | ||
|
a9df4e3a54 | ||
|
30090a09bf | ||
|
0452f3dcf9 | ||
|
9d426dfe3f | ||
|
106a325ef1 | ||
|
5039a71846 | ||
|
5edcc7c2eb | ||
|
567dd786d1 | ||
|
3a79cfd82e | ||
|
6533628dfb | ||
|
4fb379afb4 | ||
|
551fdfe0c5 | ||
|
fe51f72040 | ||
|
eb7484c671 | ||
|
b8baff4290 | ||
|
883f524fe4 | ||
|
835124eba2 | ||
|
4725624d46 | ||
|
5e13077fd2 | ||
|
b552c413f9 | ||
|
dce3de164f | ||
|
cb27f244dc | ||
|
0d32ec028c | ||
|
e193c72d12 | ||
|
40feac749a | ||
|
bd3359b486 | ||
|
1b60f5e63b | ||
|
cbce24d716 | ||
|
9d0bb5e392 | ||
|
71e7120501 | ||
|
bd49fcb001 | ||
|
b873e689db | ||
|
bd8563e212 | ||
|
98f9a7d009 | ||
|
79470ffff7 | ||
|
b2dfe0889a | ||
|
0c670f2f9e | ||
|
8194595ec9 | ||
|
4dbcf0400d | ||
|
44af6c42a2 | ||
|
12397d76b8 | ||
|
d7380dc549 | ||
|
2126e4cf32 | ||
|
b2f6e1cf1a | ||
|
4dfb85f062 | ||
|
7c9437f0a9 | ||
|
ebb9f1a53f | ||
|
b43d4909cd | ||
|
96ddef3920 | ||
|
c24934c0c3 | ||
|
8f88ed8c44 | ||
|
c1ed5d4bfd | ||
|
abf85faf79 | ||
|
162bb0a85f | ||
|
826c968d0a | ||
|
185ec4e306 | ||
|
70ddd71c0e | ||
|
1485d26aa2 | ||
|
e44ccd5787 | ||
|
ab4daf2879 | ||
|
db9eaa7503 | ||
|
a60104517d | ||
|
c4612b7484 | ||
|
731c5a2092 | ||
|
a0d10c2d4c | ||
|
c4f12e9b22 | ||
|
7efbd55b69 | ||
|
c6e20e4444 | ||
|
5dbec5b383 | ||
|
b2c082bba2 | ||
|
71a64299e8 | ||
|
0413342ee3 | ||
|
07ba16ac3a | ||
|
f28ad69c38 | ||
|
a4db92ce72 | ||
|
5b71cee487 | ||
|
9e92f65a27 | ||
|
49a71819a1 | ||
|
6c29f726bc | ||
|
22542eeab0 | ||
|
e4bfa6da13 | ||
|
ed7d11525a | ||
|
5b1dcccddc | ||
|
992a08f5ce | ||
|
4ea7b9aa2e | ||
|
49ef408699 | ||
|
0487f2fb7a | ||
|
abcb769fdf | ||
|
e43c8acd30 | ||
|
d66fedb921 | ||
|
8e6f1a5135 | ||
|
97604a93dd | ||
|
d266e9e123 | ||
|
fa747ba6c4 | ||
|
7ac8bf91df | ||
|
7883e00b44 | ||
|
772d36015c | ||
|
f381211291 | ||
|
0692727605 | ||
|
aca4cb233d | ||
|
892be78927 | ||
|
01ef3b774f | ||
|
0de73cd939 | ||
|
f59174575e | ||
|
9041dead7f | ||
|
fbda3ca695 | ||
|
7db8001d54 | ||
|
6aa4376fca | ||
|
4ea308f75a | ||
|
5a0fabb84f | ||
|
ba28c39ed7 | ||
|
f0c8601c9e | ||
|
78d1b5e0e0 | ||
|
c2ccff4e38 | ||
|
f79ef9b37b | ||
|
b0d18cae6a | ||
|
e5f06eb551 | ||
|
2f228eeaef | ||
|
15057bed1d | ||
|
c68030e9fa | ||
|
9cb99e3290 | ||
|
fd95839701 | ||
|
b736e0a0e2 | ||
|
3b0eb017b6 | ||
|
a3e61a710f | ||
|
78d5d281a8 | ||
|
6305023219 | ||
|
c7dda72a84 | ||
|
849691e087 | ||
|
6a1e8295b1 | ||
|
52f2b9341a | ||
|
6c552bec07 | ||
|
eb5706ee4b | ||
|
c01ce9e3de | ||
|
acdefb4f70 | ||
|
ebb78158b6 | ||
|
7356c8c3de | ||
|
7caedcb50d | ||
|
8e15246951 | ||
|
1856e09a0c | ||
|
e47568e147 | ||
|
a464e41ad9 | ||
|
a1082ebae9 | ||
|
4cd4ad22b6 | ||
|
cde12cde03 | ||
|
3ce5e0ab0e | ||
|
f2704520de | ||
|
63820c4300 | ||
|
3282a5a74c | ||
|
94a18c1a95 | ||
|
303e134359 | ||
|
aac793af09 | ||
|
74ec038ce2 | ||
|
3b6f1e50e2 | ||
|
c702ce3802 | ||
|
a37f403410 | ||
|
9248a954bd | ||
|
f82edae5a1 | ||
|
c5be656320 | ||
|
7f035e7613 | ||
|
89a7ad6f81 | ||
|
f432f4f698 | ||
|
5ef2d5cd9f | ||
|
54b36bc2d1 | ||
|
acc3e441ac | ||
|
fcceda72db | ||
|
f0f91e838f | ||
|
733e0ebf9d | ||
|
832734ccb4 | ||
|
84b4ac1c51 | ||
|
b544827192 | ||
|
b139e21ca3 | ||
|
204612ca85 | ||
|
36fbafa0f8 | ||
|
390dc9a560 | ||
|
882c1053ee | ||
|
0059f53196 | ||
|
ec1be81de7 | ||
|
41228a5ba9 | ||
|
b84c35acf5 | ||
|
3705f6d096 | ||
|
df8c092212 | ||
|
3ac1e64c56 | ||
|
55d2e598db | ||
|
3c67c7b32c | ||
|
5264ffc0e5 | ||
|
c5b8531ef1 | ||
|
c787c27901 | ||
|
83fc2bf25a | ||
|
27b217a4ed | ||
|
137f3d44d6 | ||
|
88fbb691d8 | ||
|
41bfa3fc01 | ||
|
ef08677287 | ||
|
08789adbb4 | ||
|
b8b9b8463c | ||
|
7d8c17cb93 | ||
|
b6413b6e6e | ||
|
41db5b8848 | ||
|
a1b990a078 | ||
|
3d277270a4 | ||
|
a4e9410c07 | ||
|
78e8b93125 | ||
|
7daf95fcb4 | ||
|
f8d6998b22 | ||
|
7b39002476 | ||
|
e064791870 | ||
|
d756548ac3 | ||
|
0171e4d899 | ||
|
a2054fb7dd | ||
|
7c58f8b41d | ||
|
f07dcb1508 | ||
|
e3f62e4a1a | ||
|
ee3bdbc2ed | ||
|
2599b94786 | ||
|
f07c9c6dcf | ||
|
9d77b5a956 | ||
|
bbaa3e6602 | ||
|
c677c946ea | ||
|
03743fa9fc | ||
|
87063851be | ||
|
e12e278efc | ||
|
516c1a7910 | ||
|
2d628acf60 | ||
|
00b95dd72e | ||
|
2293f77841 | ||
|
212771244a | ||
|
c953701623 | ||
|
8dd953de48 | ||
|
9506412aba | ||
|
5fc33aeef5 | ||
|
53b195ede9 | ||
|
3425851dc7 | ||
|
6ecaa16cd5 | ||
|
fff0d1c988 | ||
|
987b5a2290 | ||
|
c791a45aae | ||
|
0df29f344e | ||
|
910d210e52 | ||
|
344d2d92c4 | ||
|
b719a0ee35 | ||
|
f78a3fb92e | ||
|
25329d2752 | ||
|
df4d80ff26 | ||
|
5fe8303184 | ||
|
0724dc1c0e | ||
|
5b916567fe | ||
|
260bfd176e | ||
|
13ab06ecb1 | ||
|
cfce914889 | ||
|
72e2d1a2bf | ||
|
32f3d947bb | ||
|
c90210c063 | ||
|
21a8726a47 | ||
|
710b0013c9 | ||
|
b1cdbe1656 | ||
|
34736af561 | ||
|
eafb32b9a0 | ||
|
de594ce7f2 | ||
|
ca7f267103 | ||
|
e172a8f3c0 | ||
|
f7abc69861 | ||
|
624c59cd5e | ||
|
5ae32de709 | ||
|
7b15e54b7d | ||
|
ccd007355c | ||
|
ec9d00a34d | ||
|
8e2f78ceba | ||
|
36aba02093 | ||
|
a5dd330218 | ||
|
f5c91d77d2 | ||
|
cda15026e5 | ||
|
5919be1451 | ||
|
93949e8222 | ||
|
fc0eb87620 | ||
|
5872caee54 | ||
|
0b9fca2263 | ||
|
a7005f6a77 | ||
|
28e573b73c | ||
|
ac819cd1b9 | ||
|
6d0f72f13b | ||
|
fc33a4a72d | ||
|
8b6ae46a1d | ||
|
ad822c02d8 | ||
|
03a5ad3d94 | ||
|
dad1b4780c | ||
|
edfedec65c | ||
|
dd0fe36af0 | ||
|
dfdd5c6c1c | ||
|
0744a549dd | ||
|
01b5ed2304 | ||
|
77617a05c2 | ||
|
824824b402 | ||
|
3d8eb01c4c | ||
|
41adcef8f8 | ||
|
6e19e922f8 | ||
|
860d9b21f0 | ||
|
bf5a6237d8 | ||
|
ac4d4d1da9 | ||
|
0b284f8230 | ||
|
fcdea73b4f | ||
|
6fee7fdfe3 | ||
|
34117522b2 | ||
|
4ea1416fdd | ||
|
c4bfe38ee0 | ||
|
acb4ffb758 | ||
|
11e2637eeb | ||
|
7775bdabd5 | ||
|
ff43403a05 | ||
|
278756be49 | ||
|
98312c172b | ||
|
f2eaa09e96 | ||
|
42fd38e2c0 | ||
|
3a55faf9f3 | ||
|
1fcccb2472 | ||
|
ce20060cc8 | ||
|
a9171018d4 | ||
|
0d9464bb92 | ||
|
43c3154a55 | ||
|
c81b4df8b7 | ||
|
fb695616a6 | ||
|
d03c5549a6 | ||
|
f8690da7fd | ||
|
0637dd62d7 | ||
|
3becefab1f | ||
|
8454264cfc | ||
|
071207ce48 | ||
|
dded92b85d | ||
|
05ab491d2e | ||
|
1a137780ad | ||
|
3c8f38f8a6 | ||
|
ff435227e9 | ||
|
fcdc3f67af | ||
|
299936e554 | ||
|
b5cd160ebb | ||
|
43076a2548 | ||
|
c0f1129a9d | ||
|
2e192f0467 | ||
|
9062f19a97 | ||
|
f51e40a1de | ||
|
4b4fce01f6 | ||
|
2ac8a0c0a6 | ||
|
e411024696 | ||
|
01a27e22b4 | ||
|
d56547e830 | ||
|
7553c4aed9 | ||
|
b8d9e1d25c | ||
|
593304bc43 | ||
|
bd4f2d086c | ||
|
a9ca30fe34 | ||
|
4afff131f4 | ||
|
d17440c96f | ||
|
6030730870 | ||
|
1fcfadb9c8 | ||
|
c66be4a858 | ||
|
f1a98e94da | ||
|
169e4681c3 | ||
|
c241b12308 | ||
|
fab6870710 | ||
|
2674ec893a | ||
|
3f7b5e6db3 | ||
|
3edfc1611e | ||
|
2e6f2cac27 | ||
|
b9436e4851 | ||
|
d72ee71368 | ||
|
17f5b35b1d | ||
|
b0a7452d48 | ||
|
6db5c63307 | ||
|
df2cda5b66 | ||
|
42c49945ad |
10
.gitignore
vendored
10
.gitignore
vendored
@@ -1,11 +1,15 @@
|
|||||||
*.pyo
|
|
||||||
*.pyc
|
*.pyc
|
||||||
|
*.pyo
|
||||||
*_dis
|
*_dis
|
||||||
*~
|
*~
|
||||||
/.cache
|
/.cache
|
||||||
/.eggs
|
/.eggs
|
||||||
|
/.hypothesis
|
||||||
|
/.idea
|
||||||
|
/.pytest_cache
|
||||||
/.python-version
|
/.python-version
|
||||||
/.tox
|
/.tox
|
||||||
|
/.venv*
|
||||||
/README
|
/README
|
||||||
/__pkginfo__.pyc
|
/__pkginfo__.pyc
|
||||||
/dist
|
/dist
|
||||||
@@ -14,8 +18,6 @@
|
|||||||
/tmp
|
/tmp
|
||||||
/uncompyle6.egg-info
|
/uncompyle6.egg-info
|
||||||
/unpyc
|
/unpyc
|
||||||
|
ChangeLog
|
||||||
__pycache__
|
__pycache__
|
||||||
build
|
build
|
||||||
/.venv*
|
|
||||||
/.idea
|
|
||||||
/.hypothesis
|
|
||||||
|
674
COPYING
Normal file
674
COPYING
Normal file
@@ -0,0 +1,674 @@
|
|||||||
|
GNU GENERAL PUBLIC LICENSE
|
||||||
|
Version 3, 29 June 2007
|
||||||
|
|
||||||
|
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
|
||||||
|
Everyone is permitted to copy and distribute verbatim copies
|
||||||
|
of this license document, but changing it is not allowed.
|
||||||
|
|
||||||
|
Preamble
|
||||||
|
|
||||||
|
The GNU General Public License is a free, copyleft license for
|
||||||
|
software and other kinds of works.
|
||||||
|
|
||||||
|
The licenses for most software and other practical works are designed
|
||||||
|
to take away your freedom to share and change the works. By contrast,
|
||||||
|
the GNU General Public License is intended to guarantee your freedom to
|
||||||
|
share and change all versions of a program--to make sure it remains free
|
||||||
|
software for all its users. We, the Free Software Foundation, use the
|
||||||
|
GNU General Public License for most of our software; it applies also to
|
||||||
|
any other work released this way by its authors. You can apply it to
|
||||||
|
your programs, too.
|
||||||
|
|
||||||
|
When we speak of free software, we are referring to freedom, not
|
||||||
|
price. Our General Public Licenses are designed to make sure that you
|
||||||
|
have the freedom to distribute copies of free software (and charge for
|
||||||
|
them if you wish), that you receive source code or can get it if you
|
||||||
|
want it, that you can change the software or use pieces of it in new
|
||||||
|
free programs, and that you know you can do these things.
|
||||||
|
|
||||||
|
To protect your rights, we need to prevent others from denying you
|
||||||
|
these rights or asking you to surrender the rights. Therefore, you have
|
||||||
|
certain responsibilities if you distribute copies of the software, or if
|
||||||
|
you modify it: responsibilities to respect the freedom of others.
|
||||||
|
|
||||||
|
For example, if you distribute copies of such a program, whether
|
||||||
|
gratis or for a fee, you must pass on to the recipients the same
|
||||||
|
freedoms that you received. You must make sure that they, too, receive
|
||||||
|
or can get the source code. And you must show them these terms so they
|
||||||
|
know their rights.
|
||||||
|
|
||||||
|
Developers that use the GNU GPL protect your rights with two steps:
|
||||||
|
(1) assert copyright on the software, and (2) offer you this License
|
||||||
|
giving you legal permission to copy, distribute and/or modify it.
|
||||||
|
|
||||||
|
For the developers' and authors' protection, the GPL clearly explains
|
||||||
|
that there is no warranty for this free software. For both users' and
|
||||||
|
authors' sake, the GPL requires that modified versions be marked as
|
||||||
|
changed, so that their problems will not be attributed erroneously to
|
||||||
|
authors of previous versions.
|
||||||
|
|
||||||
|
Some devices are designed to deny users access to install or run
|
||||||
|
modified versions of the software inside them, although the manufacturer
|
||||||
|
can do so. This is fundamentally incompatible with the aim of
|
||||||
|
protecting users' freedom to change the software. The systematic
|
||||||
|
pattern of such abuse occurs in the area of products for individuals to
|
||||||
|
use, which is precisely where it is most unacceptable. Therefore, we
|
||||||
|
have designed this version of the GPL to prohibit the practice for those
|
||||||
|
products. If such problems arise substantially in other domains, we
|
||||||
|
stand ready to extend this provision to those domains in future versions
|
||||||
|
of the GPL, as needed to protect the freedom of users.
|
||||||
|
|
||||||
|
Finally, every program is threatened constantly by software patents.
|
||||||
|
States should not allow patents to restrict development and use of
|
||||||
|
software on general-purpose computers, but in those that do, we wish to
|
||||||
|
avoid the special danger that patents applied to a free program could
|
||||||
|
make it effectively proprietary. To prevent this, the GPL assures that
|
||||||
|
patents cannot be used to render the program non-free.
|
||||||
|
|
||||||
|
The precise terms and conditions for copying, distribution and
|
||||||
|
modification follow.
|
||||||
|
|
||||||
|
TERMS AND CONDITIONS
|
||||||
|
|
||||||
|
0. Definitions.
|
||||||
|
|
||||||
|
"This License" refers to version 3 of the GNU General Public License.
|
||||||
|
|
||||||
|
"Copyright" also means copyright-like laws that apply to other kinds of
|
||||||
|
works, such as semiconductor masks.
|
||||||
|
|
||||||
|
"The Program" refers to any copyrightable work licensed under this
|
||||||
|
License. Each licensee is addressed as "you". "Licensees" and
|
||||||
|
"recipients" may be individuals or organizations.
|
||||||
|
|
||||||
|
To "modify" a work means to copy from or adapt all or part of the work
|
||||||
|
in a fashion requiring copyright permission, other than the making of an
|
||||||
|
exact copy. The resulting work is called a "modified version" of the
|
||||||
|
earlier work or a work "based on" the earlier work.
|
||||||
|
|
||||||
|
A "covered work" means either the unmodified Program or a work based
|
||||||
|
on the Program.
|
||||||
|
|
||||||
|
To "propagate" a work means to do anything with it that, without
|
||||||
|
permission, would make you directly or secondarily liable for
|
||||||
|
infringement under applicable copyright law, except executing it on a
|
||||||
|
computer or modifying a private copy. Propagation includes copying,
|
||||||
|
distribution (with or without modification), making available to the
|
||||||
|
public, and in some countries other activities as well.
|
||||||
|
|
||||||
|
To "convey" a work means any kind of propagation that enables other
|
||||||
|
parties to make or receive copies. Mere interaction with a user through
|
||||||
|
a computer network, with no transfer of a copy, is not conveying.
|
||||||
|
|
||||||
|
An interactive user interface displays "Appropriate Legal Notices"
|
||||||
|
to the extent that it includes a convenient and prominently visible
|
||||||
|
feature that (1) displays an appropriate copyright notice, and (2)
|
||||||
|
tells the user that there is no warranty for the work (except to the
|
||||||
|
extent that warranties are provided), that licensees may convey the
|
||||||
|
work under this License, and how to view a copy of this License. If
|
||||||
|
the interface presents a list of user commands or options, such as a
|
||||||
|
menu, a prominent item in the list meets this criterion.
|
||||||
|
|
||||||
|
1. Source Code.
|
||||||
|
|
||||||
|
The "source code" for a work means the preferred form of the work
|
||||||
|
for making modifications to it. "Object code" means any non-source
|
||||||
|
form of a work.
|
||||||
|
|
||||||
|
A "Standard Interface" means an interface that either is an official
|
||||||
|
standard defined by a recognized standards body, or, in the case of
|
||||||
|
interfaces specified for a particular programming language, one that
|
||||||
|
is widely used among developers working in that language.
|
||||||
|
|
||||||
|
The "System Libraries" of an executable work include anything, other
|
||||||
|
than the work as a whole, that (a) is included in the normal form of
|
||||||
|
packaging a Major Component, but which is not part of that Major
|
||||||
|
Component, and (b) serves only to enable use of the work with that
|
||||||
|
Major Component, or to implement a Standard Interface for which an
|
||||||
|
implementation is available to the public in source code form. A
|
||||||
|
"Major Component", in this context, means a major essential component
|
||||||
|
(kernel, window system, and so on) of the specific operating system
|
||||||
|
(if any) on which the executable work runs, or a compiler used to
|
||||||
|
produce the work, or an object code interpreter used to run it.
|
||||||
|
|
||||||
|
The "Corresponding Source" for a work in object code form means all
|
||||||
|
the source code needed to generate, install, and (for an executable
|
||||||
|
work) run the object code and to modify the work, including scripts to
|
||||||
|
control those activities. However, it does not include the work's
|
||||||
|
System Libraries, or general-purpose tools or generally available free
|
||||||
|
programs which are used unmodified in performing those activities but
|
||||||
|
which are not part of the work. For example, Corresponding Source
|
||||||
|
includes interface definition files associated with source files for
|
||||||
|
the work, and the source code for shared libraries and dynamically
|
||||||
|
linked subprograms that the work is specifically designed to require,
|
||||||
|
such as by intimate data communication or control flow between those
|
||||||
|
subprograms and other parts of the work.
|
||||||
|
|
||||||
|
The Corresponding Source need not include anything that users
|
||||||
|
can regenerate automatically from other parts of the Corresponding
|
||||||
|
Source.
|
||||||
|
|
||||||
|
The Corresponding Source for a work in source code form is that
|
||||||
|
same work.
|
||||||
|
|
||||||
|
2. Basic Permissions.
|
||||||
|
|
||||||
|
All rights granted under this License are granted for the term of
|
||||||
|
copyright on the Program, and are irrevocable provided the stated
|
||||||
|
conditions are met. This License explicitly affirms your unlimited
|
||||||
|
permission to run the unmodified Program. The output from running a
|
||||||
|
covered work is covered by this License only if the output, given its
|
||||||
|
content, constitutes a covered work. This License acknowledges your
|
||||||
|
rights of fair use or other equivalent, as provided by copyright law.
|
||||||
|
|
||||||
|
You may make, run and propagate covered works that you do not
|
||||||
|
convey, without conditions so long as your license otherwise remains
|
||||||
|
in force. You may convey covered works to others for the sole purpose
|
||||||
|
of having them make modifications exclusively for you, or provide you
|
||||||
|
with facilities for running those works, provided that you comply with
|
||||||
|
the terms of this License in conveying all material for which you do
|
||||||
|
not control copyright. Those thus making or running the covered works
|
||||||
|
for you must do so exclusively on your behalf, under your direction
|
||||||
|
and control, on terms that prohibit them from making any copies of
|
||||||
|
your copyrighted material outside their relationship with you.
|
||||||
|
|
||||||
|
Conveying under any other circumstances is permitted solely under
|
||||||
|
the conditions stated below. Sublicensing is not allowed; section 10
|
||||||
|
makes it unnecessary.
|
||||||
|
|
||||||
|
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
|
||||||
|
|
||||||
|
No covered work shall be deemed part of an effective technological
|
||||||
|
measure under any applicable law fulfilling obligations under article
|
||||||
|
11 of the WIPO copyright treaty adopted on 20 December 1996, or
|
||||||
|
similar laws prohibiting or restricting circumvention of such
|
||||||
|
measures.
|
||||||
|
|
||||||
|
When you convey a covered work, you waive any legal power to forbid
|
||||||
|
circumvention of technological measures to the extent such circumvention
|
||||||
|
is effected by exercising rights under this License with respect to
|
||||||
|
the covered work, and you disclaim any intention to limit operation or
|
||||||
|
modification of the work as a means of enforcing, against the work's
|
||||||
|
users, your or third parties' legal rights to forbid circumvention of
|
||||||
|
technological measures.
|
||||||
|
|
||||||
|
4. Conveying Verbatim Copies.
|
||||||
|
|
||||||
|
You may convey verbatim copies of the Program's source code as you
|
||||||
|
receive it, in any medium, provided that you conspicuously and
|
||||||
|
appropriately publish on each copy an appropriate copyright notice;
|
||||||
|
keep intact all notices stating that this License and any
|
||||||
|
non-permissive terms added in accord with section 7 apply to the code;
|
||||||
|
keep intact all notices of the absence of any warranty; and give all
|
||||||
|
recipients a copy of this License along with the Program.
|
||||||
|
|
||||||
|
You may charge any price or no price for each copy that you convey,
|
||||||
|
and you may offer support or warranty protection for a fee.
|
||||||
|
|
||||||
|
5. Conveying Modified Source Versions.
|
||||||
|
|
||||||
|
You may convey a work based on the Program, or the modifications to
|
||||||
|
produce it from the Program, in the form of source code under the
|
||||||
|
terms of section 4, provided that you also meet all of these conditions:
|
||||||
|
|
||||||
|
a) The work must carry prominent notices stating that you modified
|
||||||
|
it, and giving a relevant date.
|
||||||
|
|
||||||
|
b) The work must carry prominent notices stating that it is
|
||||||
|
released under this License and any conditions added under section
|
||||||
|
7. This requirement modifies the requirement in section 4 to
|
||||||
|
"keep intact all notices".
|
||||||
|
|
||||||
|
c) You must license the entire work, as a whole, under this
|
||||||
|
License to anyone who comes into possession of a copy. This
|
||||||
|
License will therefore apply, along with any applicable section 7
|
||||||
|
additional terms, to the whole of the work, and all its parts,
|
||||||
|
regardless of how they are packaged. This License gives no
|
||||||
|
permission to license the work in any other way, but it does not
|
||||||
|
invalidate such permission if you have separately received it.
|
||||||
|
|
||||||
|
d) If the work has interactive user interfaces, each must display
|
||||||
|
Appropriate Legal Notices; however, if the Program has interactive
|
||||||
|
interfaces that do not display Appropriate Legal Notices, your
|
||||||
|
work need not make them do so.
|
||||||
|
|
||||||
|
A compilation of a covered work with other separate and independent
|
||||||
|
works, which are not by their nature extensions of the covered work,
|
||||||
|
and which are not combined with it such as to form a larger program,
|
||||||
|
in or on a volume of a storage or distribution medium, is called an
|
||||||
|
"aggregate" if the compilation and its resulting copyright are not
|
||||||
|
used to limit the access or legal rights of the compilation's users
|
||||||
|
beyond what the individual works permit. Inclusion of a covered work
|
||||||
|
in an aggregate does not cause this License to apply to the other
|
||||||
|
parts of the aggregate.
|
||||||
|
|
||||||
|
6. Conveying Non-Source Forms.
|
||||||
|
|
||||||
|
You may convey a covered work in object code form under the terms
|
||||||
|
of sections 4 and 5, provided that you also convey the
|
||||||
|
machine-readable Corresponding Source under the terms of this License,
|
||||||
|
in one of these ways:
|
||||||
|
|
||||||
|
a) Convey the object code in, or embodied in, a physical product
|
||||||
|
(including a physical distribution medium), accompanied by the
|
||||||
|
Corresponding Source fixed on a durable physical medium
|
||||||
|
customarily used for software interchange.
|
||||||
|
|
||||||
|
b) Convey the object code in, or embodied in, a physical product
|
||||||
|
(including a physical distribution medium), accompanied by a
|
||||||
|
written offer, valid for at least three years and valid for as
|
||||||
|
long as you offer spare parts or customer support for that product
|
||||||
|
model, to give anyone who possesses the object code either (1) a
|
||||||
|
copy of the Corresponding Source for all the software in the
|
||||||
|
product that is covered by this License, on a durable physical
|
||||||
|
medium customarily used for software interchange, for a price no
|
||||||
|
more than your reasonable cost of physically performing this
|
||||||
|
conveying of source, or (2) access to copy the
|
||||||
|
Corresponding Source from a network server at no charge.
|
||||||
|
|
||||||
|
c) Convey individual copies of the object code with a copy of the
|
||||||
|
written offer to provide the Corresponding Source. This
|
||||||
|
alternative is allowed only occasionally and noncommercially, and
|
||||||
|
only if you received the object code with such an offer, in accord
|
||||||
|
with subsection 6b.
|
||||||
|
|
||||||
|
d) Convey the object code by offering access from a designated
|
||||||
|
place (gratis or for a charge), and offer equivalent access to the
|
||||||
|
Corresponding Source in the same way through the same place at no
|
||||||
|
further charge. You need not require recipients to copy the
|
||||||
|
Corresponding Source along with the object code. If the place to
|
||||||
|
copy the object code is a network server, the Corresponding Source
|
||||||
|
may be on a different server (operated by you or a third party)
|
||||||
|
that supports equivalent copying facilities, provided you maintain
|
||||||
|
clear directions next to the object code saying where to find the
|
||||||
|
Corresponding Source. Regardless of what server hosts the
|
||||||
|
Corresponding Source, you remain obligated to ensure that it is
|
||||||
|
available for as long as needed to satisfy these requirements.
|
||||||
|
|
||||||
|
e) Convey the object code using peer-to-peer transmission, provided
|
||||||
|
you inform other peers where the object code and Corresponding
|
||||||
|
Source of the work are being offered to the general public at no
|
||||||
|
charge under subsection 6d.
|
||||||
|
|
||||||
|
A separable portion of the object code, whose source code is excluded
|
||||||
|
from the Corresponding Source as a System Library, need not be
|
||||||
|
included in conveying the object code work.
|
||||||
|
|
||||||
|
A "User Product" is either (1) a "consumer product", which means any
|
||||||
|
tangible personal property which is normally used for personal, family,
|
||||||
|
or household purposes, or (2) anything designed or sold for incorporation
|
||||||
|
into a dwelling. In determining whether a product is a consumer product,
|
||||||
|
doubtful cases shall be resolved in favor of coverage. For a particular
|
||||||
|
product received by a particular user, "normally used" refers to a
|
||||||
|
typical or common use of that class of product, regardless of the status
|
||||||
|
of the particular user or of the way in which the particular user
|
||||||
|
actually uses, or expects or is expected to use, the product. A product
|
||||||
|
is a consumer product regardless of whether the product has substantial
|
||||||
|
commercial, industrial or non-consumer uses, unless such uses represent
|
||||||
|
the only significant mode of use of the product.
|
||||||
|
|
||||||
|
"Installation Information" for a User Product means any methods,
|
||||||
|
procedures, authorization keys, or other information required to install
|
||||||
|
and execute modified versions of a covered work in that User Product from
|
||||||
|
a modified version of its Corresponding Source. The information must
|
||||||
|
suffice to ensure that the continued functioning of the modified object
|
||||||
|
code is in no case prevented or interfered with solely because
|
||||||
|
modification has been made.
|
||||||
|
|
||||||
|
If you convey an object code work under this section in, or with, or
|
||||||
|
specifically for use in, a User Product, and the conveying occurs as
|
||||||
|
part of a transaction in which the right of possession and use of the
|
||||||
|
User Product is transferred to the recipient in perpetuity or for a
|
||||||
|
fixed term (regardless of how the transaction is characterized), the
|
||||||
|
Corresponding Source conveyed under this section must be accompanied
|
||||||
|
by the Installation Information. But this requirement does not apply
|
||||||
|
if neither you nor any third party retains the ability to install
|
||||||
|
modified object code on the User Product (for example, the work has
|
||||||
|
been installed in ROM).
|
||||||
|
|
||||||
|
The requirement to provide Installation Information does not include a
|
||||||
|
requirement to continue to provide support service, warranty, or updates
|
||||||
|
for a work that has been modified or installed by the recipient, or for
|
||||||
|
the User Product in which it has been modified or installed. Access to a
|
||||||
|
network may be denied when the modification itself materially and
|
||||||
|
adversely affects the operation of the network or violates the rules and
|
||||||
|
protocols for communication across the network.
|
||||||
|
|
||||||
|
Corresponding Source conveyed, and Installation Information provided,
|
||||||
|
in accord with this section must be in a format that is publicly
|
||||||
|
documented (and with an implementation available to the public in
|
||||||
|
source code form), and must require no special password or key for
|
||||||
|
unpacking, reading or copying.
|
||||||
|
|
||||||
|
7. Additional Terms.
|
||||||
|
|
||||||
|
"Additional permissions" are terms that supplement the terms of this
|
||||||
|
License by making exceptions from one or more of its conditions.
|
||||||
|
Additional permissions that are applicable to the entire Program shall
|
||||||
|
be treated as though they were included in this License, to the extent
|
||||||
|
that they are valid under applicable law. If additional permissions
|
||||||
|
apply only to part of the Program, that part may be used separately
|
||||||
|
under those permissions, but the entire Program remains governed by
|
||||||
|
this License without regard to the additional permissions.
|
||||||
|
|
||||||
|
When you convey a copy of a covered work, you may at your option
|
||||||
|
remove any additional permissions from that copy, or from any part of
|
||||||
|
it. (Additional permissions may be written to require their own
|
||||||
|
removal in certain cases when you modify the work.) You may place
|
||||||
|
additional permissions on material, added by you to a covered work,
|
||||||
|
for which you have or can give appropriate copyright permission.
|
||||||
|
|
||||||
|
Notwithstanding any other provision of this License, for material you
|
||||||
|
add to a covered work, you may (if authorized by the copyright holders of
|
||||||
|
that material) supplement the terms of this License with terms:
|
||||||
|
|
||||||
|
a) Disclaiming warranty or limiting liability differently from the
|
||||||
|
terms of sections 15 and 16 of this License; or
|
||||||
|
|
||||||
|
b) Requiring preservation of specified reasonable legal notices or
|
||||||
|
author attributions in that material or in the Appropriate Legal
|
||||||
|
Notices displayed by works containing it; or
|
||||||
|
|
||||||
|
c) Prohibiting misrepresentation of the origin of that material, or
|
||||||
|
requiring that modified versions of such material be marked in
|
||||||
|
reasonable ways as different from the original version; or
|
||||||
|
|
||||||
|
d) Limiting the use for publicity purposes of names of licensors or
|
||||||
|
authors of the material; or
|
||||||
|
|
||||||
|
e) Declining to grant rights under trademark law for use of some
|
||||||
|
trade names, trademarks, or service marks; or
|
||||||
|
|
||||||
|
f) Requiring indemnification of licensors and authors of that
|
||||||
|
material by anyone who conveys the material (or modified versions of
|
||||||
|
it) with contractual assumptions of liability to the recipient, for
|
||||||
|
any liability that these contractual assumptions directly impose on
|
||||||
|
those licensors and authors.
|
||||||
|
|
||||||
|
All other non-permissive additional terms are considered "further
|
||||||
|
restrictions" within the meaning of section 10. If the Program as you
|
||||||
|
received it, or any part of it, contains a notice stating that it is
|
||||||
|
governed by this License along with a term that is a further
|
||||||
|
restriction, you may remove that term. If a license document contains
|
||||||
|
a further restriction but permits relicensing or conveying under this
|
||||||
|
License, you may add to a covered work material governed by the terms
|
||||||
|
of that license document, provided that the further restriction does
|
||||||
|
not survive such relicensing or conveying.
|
||||||
|
|
||||||
|
If you add terms to a covered work in accord with this section, you
|
||||||
|
must place, in the relevant source files, a statement of the
|
||||||
|
additional terms that apply to those files, or a notice indicating
|
||||||
|
where to find the applicable terms.
|
||||||
|
|
||||||
|
Additional terms, permissive or non-permissive, may be stated in the
|
||||||
|
form of a separately written license, or stated as exceptions;
|
||||||
|
the above requirements apply either way.
|
||||||
|
|
||||||
|
8. Termination.
|
||||||
|
|
||||||
|
You may not propagate or modify a covered work except as expressly
|
||||||
|
provided under this License. Any attempt otherwise to propagate or
|
||||||
|
modify it is void, and will automatically terminate your rights under
|
||||||
|
this License (including any patent licenses granted under the third
|
||||||
|
paragraph of section 11).
|
||||||
|
|
||||||
|
However, if you cease all violation of this License, then your
|
||||||
|
license from a particular copyright holder is reinstated (a)
|
||||||
|
provisionally, unless and until the copyright holder explicitly and
|
||||||
|
finally terminates your license, and (b) permanently, if the copyright
|
||||||
|
holder fails to notify you of the violation by some reasonable means
|
||||||
|
prior to 60 days after the cessation.
|
||||||
|
|
||||||
|
Moreover, your license from a particular copyright holder is
|
||||||
|
reinstated permanently if the copyright holder notifies you of the
|
||||||
|
violation by some reasonable means, this is the first time you have
|
||||||
|
received notice of violation of this License (for any work) from that
|
||||||
|
copyright holder, and you cure the violation prior to 30 days after
|
||||||
|
your receipt of the notice.
|
||||||
|
|
||||||
|
Termination of your rights under this section does not terminate the
|
||||||
|
licenses of parties who have received copies or rights from you under
|
||||||
|
this License. If your rights have been terminated and not permanently
|
||||||
|
reinstated, you do not qualify to receive new licenses for the same
|
||||||
|
material under section 10.
|
||||||
|
|
||||||
|
9. Acceptance Not Required for Having Copies.
|
||||||
|
|
||||||
|
You are not required to accept this License in order to receive or
|
||||||
|
run a copy of the Program. Ancillary propagation of a covered work
|
||||||
|
occurring solely as a consequence of using peer-to-peer transmission
|
||||||
|
to receive a copy likewise does not require acceptance. However,
|
||||||
|
nothing other than this License grants you permission to propagate or
|
||||||
|
modify any covered work. These actions infringe copyright if you do
|
||||||
|
not accept this License. Therefore, by modifying or propagating a
|
||||||
|
covered work, you indicate your acceptance of this License to do so.
|
||||||
|
|
||||||
|
10. Automatic Licensing of Downstream Recipients.
|
||||||
|
|
||||||
|
Each time you convey a covered work, the recipient automatically
|
||||||
|
receives a license from the original licensors, to run, modify and
|
||||||
|
propagate that work, subject to this License. You are not responsible
|
||||||
|
for enforcing compliance by third parties with this License.
|
||||||
|
|
||||||
|
An "entity transaction" is a transaction transferring control of an
|
||||||
|
organization, or substantially all assets of one, or subdividing an
|
||||||
|
organization, or merging organizations. If propagation of a covered
|
||||||
|
work results from an entity transaction, each party to that
|
||||||
|
transaction who receives a copy of the work also receives whatever
|
||||||
|
licenses to the work the party's predecessor in interest had or could
|
||||||
|
give under the previous paragraph, plus a right to possession of the
|
||||||
|
Corresponding Source of the work from the predecessor in interest, if
|
||||||
|
the predecessor has it or can get it with reasonable efforts.
|
||||||
|
|
||||||
|
You may not impose any further restrictions on the exercise of the
|
||||||
|
rights granted or affirmed under this License. For example, you may
|
||||||
|
not impose a license fee, royalty, or other charge for exercise of
|
||||||
|
rights granted under this License, and you may not initiate litigation
|
||||||
|
(including a cross-claim or counterclaim in a lawsuit) alleging that
|
||||||
|
any patent claim is infringed by making, using, selling, offering for
|
||||||
|
sale, or importing the Program or any portion of it.
|
||||||
|
|
||||||
|
11. Patents.
|
||||||
|
|
||||||
|
A "contributor" is a copyright holder who authorizes use under this
|
||||||
|
License of the Program or a work on which the Program is based. The
|
||||||
|
work thus licensed is called the contributor's "contributor version".
|
||||||
|
|
||||||
|
A contributor's "essential patent claims" are all patent claims
|
||||||
|
owned or controlled by the contributor, whether already acquired or
|
||||||
|
hereafter acquired, that would be infringed by some manner, permitted
|
||||||
|
by this License, of making, using, or selling its contributor version,
|
||||||
|
but do not include claims that would be infringed only as a
|
||||||
|
consequence of further modification of the contributor version. For
|
||||||
|
purposes of this definition, "control" includes the right to grant
|
||||||
|
patent sublicenses in a manner consistent with the requirements of
|
||||||
|
this License.
|
||||||
|
|
||||||
|
Each contributor grants you a non-exclusive, worldwide, royalty-free
|
||||||
|
patent license under the contributor's essential patent claims, to
|
||||||
|
make, use, sell, offer for sale, import and otherwise run, modify and
|
||||||
|
propagate the contents of its contributor version.
|
||||||
|
|
||||||
|
In the following three paragraphs, a "patent license" is any express
|
||||||
|
agreement or commitment, however denominated, not to enforce a patent
|
||||||
|
(such as an express permission to practice a patent or covenant not to
|
||||||
|
sue for patent infringement). To "grant" such a patent license to a
|
||||||
|
party means to make such an agreement or commitment not to enforce a
|
||||||
|
patent against the party.
|
||||||
|
|
||||||
|
If you convey a covered work, knowingly relying on a patent license,
|
||||||
|
and the Corresponding Source of the work is not available for anyone
|
||||||
|
to copy, free of charge and under the terms of this License, through a
|
||||||
|
publicly available network server or other readily accessible means,
|
||||||
|
then you must either (1) cause the Corresponding Source to be so
|
||||||
|
available, or (2) arrange to deprive yourself of the benefit of the
|
||||||
|
patent license for this particular work, or (3) arrange, in a manner
|
||||||
|
consistent with the requirements of this License, to extend the patent
|
||||||
|
license to downstream recipients. "Knowingly relying" means you have
|
||||||
|
actual knowledge that, but for the patent license, your conveying the
|
||||||
|
covered work in a country, or your recipient's use of the covered work
|
||||||
|
in a country, would infringe one or more identifiable patents in that
|
||||||
|
country that you have reason to believe are valid.
|
||||||
|
|
||||||
|
If, pursuant to or in connection with a single transaction or
|
||||||
|
arrangement, you convey, or propagate by procuring conveyance of, a
|
||||||
|
covered work, and grant a patent license to some of the parties
|
||||||
|
receiving the covered work authorizing them to use, propagate, modify
|
||||||
|
or convey a specific copy of the covered work, then the patent license
|
||||||
|
you grant is automatically extended to all recipients of the covered
|
||||||
|
work and works based on it.
|
||||||
|
|
||||||
|
A patent license is "discriminatory" if it does not include within
|
||||||
|
the scope of its coverage, prohibits the exercise of, or is
|
||||||
|
conditioned on the non-exercise of one or more of the rights that are
|
||||||
|
specifically granted under this License. You may not convey a covered
|
||||||
|
work if you are a party to an arrangement with a third party that is
|
||||||
|
in the business of distributing software, under which you make payment
|
||||||
|
to the third party based on the extent of your activity of conveying
|
||||||
|
the work, and under which the third party grants, to any of the
|
||||||
|
parties who would receive the covered work from you, a discriminatory
|
||||||
|
patent license (a) in connection with copies of the covered work
|
||||||
|
conveyed by you (or copies made from those copies), or (b) primarily
|
||||||
|
for and in connection with specific products or compilations that
|
||||||
|
contain the covered work, unless you entered into that arrangement,
|
||||||
|
or that patent license was granted, prior to 28 March 2007.
|
||||||
|
|
||||||
|
Nothing in this License shall be construed as excluding or limiting
|
||||||
|
any implied license or other defenses to infringement that may
|
||||||
|
otherwise be available to you under applicable patent law.
|
||||||
|
|
||||||
|
12. No Surrender of Others' Freedom.
|
||||||
|
|
||||||
|
If conditions are imposed on you (whether by court order, agreement or
|
||||||
|
otherwise) that contradict the conditions of this License, they do not
|
||||||
|
excuse you from the conditions of this License. If you cannot convey a
|
||||||
|
covered work so as to satisfy simultaneously your obligations under this
|
||||||
|
License and any other pertinent obligations, then as a consequence you may
|
||||||
|
not convey it at all. For example, if you agree to terms that obligate you
|
||||||
|
to collect a royalty for further conveying from those to whom you convey
|
||||||
|
the Program, the only way you could satisfy both those terms and this
|
||||||
|
License would be to refrain entirely from conveying the Program.
|
||||||
|
|
||||||
|
13. Use with the GNU Affero General Public License.
|
||||||
|
|
||||||
|
Notwithstanding any other provision of this License, you have
|
||||||
|
permission to link or combine any covered work with a work licensed
|
||||||
|
under version 3 of the GNU Affero General Public License into a single
|
||||||
|
combined work, and to convey the resulting work. The terms of this
|
||||||
|
License will continue to apply to the part which is the covered work,
|
||||||
|
but the special requirements of the GNU Affero General Public License,
|
||||||
|
section 13, concerning interaction through a network will apply to the
|
||||||
|
combination as such.
|
||||||
|
|
||||||
|
14. Revised Versions of this License.
|
||||||
|
|
||||||
|
The Free Software Foundation may publish revised and/or new versions of
|
||||||
|
the GNU General Public License from time to time. Such new versions will
|
||||||
|
be similar in spirit to the present version, but may differ in detail to
|
||||||
|
address new problems or concerns.
|
||||||
|
|
||||||
|
Each version is given a distinguishing version number. If the
|
||||||
|
Program specifies that a certain numbered version of the GNU General
|
||||||
|
Public License "or any later version" applies to it, you have the
|
||||||
|
option of following the terms and conditions either of that numbered
|
||||||
|
version or of any later version published by the Free Software
|
||||||
|
Foundation. If the Program does not specify a version number of the
|
||||||
|
GNU General Public License, you may choose any version ever published
|
||||||
|
by the Free Software Foundation.
|
||||||
|
|
||||||
|
If the Program specifies that a proxy can decide which future
|
||||||
|
versions of the GNU General Public License can be used, that proxy's
|
||||||
|
public statement of acceptance of a version permanently authorizes you
|
||||||
|
to choose that version for the Program.
|
||||||
|
|
||||||
|
Later license versions may give you additional or different
|
||||||
|
permissions. However, no additional obligations are imposed on any
|
||||||
|
author or copyright holder as a result of your choosing to follow a
|
||||||
|
later version.
|
||||||
|
|
||||||
|
15. Disclaimer of Warranty.
|
||||||
|
|
||||||
|
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
|
||||||
|
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
|
||||||
|
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
|
||||||
|
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
|
||||||
|
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||||
|
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
|
||||||
|
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
|
||||||
|
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
|
||||||
|
|
||||||
|
16. Limitation of Liability.
|
||||||
|
|
||||||
|
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
|
||||||
|
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
|
||||||
|
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
|
||||||
|
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
|
||||||
|
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
|
||||||
|
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
|
||||||
|
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
|
||||||
|
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
|
||||||
|
SUCH DAMAGES.
|
||||||
|
|
||||||
|
17. Interpretation of Sections 15 and 16.
|
||||||
|
|
||||||
|
If the disclaimer of warranty and limitation of liability provided
|
||||||
|
above cannot be given local legal effect according to their terms,
|
||||||
|
reviewing courts shall apply local law that most closely approximates
|
||||||
|
an absolute waiver of all civil liability in connection with the
|
||||||
|
Program, unless a warranty or assumption of liability accompanies a
|
||||||
|
copy of the Program in return for a fee.
|
||||||
|
|
||||||
|
END OF TERMS AND CONDITIONS
|
||||||
|
|
||||||
|
How to Apply These Terms to Your New Programs
|
||||||
|
|
||||||
|
If you develop a new program, and you want it to be of the greatest
|
||||||
|
possible use to the public, the best way to achieve this is to make it
|
||||||
|
free software which everyone can redistribute and change under these terms.
|
||||||
|
|
||||||
|
To do so, attach the following notices to the program. It is safest
|
||||||
|
to attach them to the start of each source file to most effectively
|
||||||
|
state the exclusion of warranty; and each file should have at least
|
||||||
|
the "copyright" line and a pointer to where the full notice is found.
|
||||||
|
|
||||||
|
<one line to give the program's name and a brief idea of what it does.>
|
||||||
|
Copyright (C) <year> <name of author>
|
||||||
|
|
||||||
|
This program is free software: you can redistribute it and/or modify
|
||||||
|
it under the terms of the GNU General Public License as published by
|
||||||
|
the Free Software Foundation, either version 3 of the License, or
|
||||||
|
(at your option) any later version.
|
||||||
|
|
||||||
|
This program is distributed in the hope that it will be useful,
|
||||||
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
GNU General Public License for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU General Public License
|
||||||
|
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
Also add information on how to contact you by electronic and paper mail.
|
||||||
|
|
||||||
|
If the program does terminal interaction, make it output a short
|
||||||
|
notice like this when it starts in an interactive mode:
|
||||||
|
|
||||||
|
<program> Copyright (C) <year> <name of author>
|
||||||
|
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
|
||||||
|
This is free software, and you are welcome to redistribute it
|
||||||
|
under certain conditions; type `show c' for details.
|
||||||
|
|
||||||
|
The hypothetical commands `show w' and `show c' should show the appropriate
|
||||||
|
parts of the General Public License. Of course, your program's commands
|
||||||
|
might be different; for a GUI interface, you would use an "about box".
|
||||||
|
|
||||||
|
You should also get your employer (if you work as a programmer) or school,
|
||||||
|
if any, to sign a "copyright disclaimer" for the program, if necessary.
|
||||||
|
For more information on this, and how to apply and follow the GNU GPL, see
|
||||||
|
<http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
The GNU General Public License does not permit incorporating your program
|
||||||
|
into proprietary programs. If your program is a subroutine library, you
|
||||||
|
may consider it more useful to permit linking proprietary applications with
|
||||||
|
the library. If this is what you want to do, use the GNU Lesser General
|
||||||
|
Public License instead of this License. But first, please read
|
||||||
|
<http://www.gnu.org/philosophy/why-not-lgpl.html>.
|
93
HISTORY.md
93
HISTORY.md
@@ -1,4 +1,4 @@
|
|||||||
This project has history of over 17 years spanning back to Python 1.5
|
This project has history of over 18 years spanning back to Python 1.5
|
||||||
|
|
||||||
There have been a number of people who have worked on this. I am awed
|
There have been a number of people who have worked on this. I am awed
|
||||||
by the amount of work, number of people who have contributed to this,
|
by the amount of work, number of people who have contributed to this,
|
||||||
@@ -64,14 +64,17 @@ success that his good work deserves.
|
|||||||
Dan Pascu did a bit of work from late 2004 to early 2006 to get this
|
Dan Pascu did a bit of work from late 2004 to early 2006 to get this
|
||||||
code to handle first Python 2.3 and then 2.4 bytecodes. Because of
|
code to handle first Python 2.3 and then 2.4 bytecodes. Because of
|
||||||
jump optimization introduced in the CPython bytecode compiler at that
|
jump optimization introduced in the CPython bytecode compiler at that
|
||||||
time, various JUMP instructions were classifed as going backwards, and
|
time, various JUMP instructions were classified to assist parsing For
|
||||||
COME FROM instructions were reintroduced. See
|
example, due to the way that code generation and line number table
|
||||||
|
work, jump instructions to an earlier offset must be looping jumps,
|
||||||
|
such as those found in a "continue" statement; "COME FROM"
|
||||||
|
instructions were reintroduced. See
|
||||||
[RELEASE-2.4-CHANGELOG.txt](https://github.com/rocky/python-uncompyle6/blob/master/DECOMPYLE-2.4-CHANGELOG.txt)
|
[RELEASE-2.4-CHANGELOG.txt](https://github.com/rocky/python-uncompyle6/blob/master/DECOMPYLE-2.4-CHANGELOG.txt)
|
||||||
for more details here. There wasn't a public
|
for more details here. There wasn't a public release of RELEASE-2.4
|
||||||
release of RELEASE-2.4 and bytecodes other than Python 2.4 weren't
|
and bytecodes other than Python 2.4 weren't supported. Dan says the
|
||||||
supported. Dan says the Python 2.3 version could verify the entire
|
Python 2.3 version could verify the entire Python library. But given
|
||||||
Python library. But given subsequent bugs found like simply
|
subsequent bugs found like simply recognizing complex-number constants
|
||||||
recognizing complex-number constants in bytecode, decompilation wasn't perfect.
|
in bytecode, decompilation wasn't perfect.
|
||||||
|
|
||||||
Next we get to ["uncompyle" and
|
Next we get to ["uncompyle" and
|
||||||
PyPI](https://pypi.python.org/pypi/uncompyle/1.1) and the era of
|
PyPI](https://pypi.python.org/pypi/uncompyle/1.1) and the era of
|
||||||
@@ -109,15 +112,26 @@ Given this, perhaps it is not surprising that subsequent changes
|
|||||||
tended to shy away from using the built-in compiler technology
|
tended to shy away from using the built-in compiler technology
|
||||||
mechanisms and addressed problems and extensions by some other means.
|
mechanisms and addressed problems and extensions by some other means.
|
||||||
|
|
||||||
Specifically, in `uncompyle`, decompilation of python bytecode 2.5 & 2.6
|
Specifically, in `uncompyle`, decompilation of python bytecode 2.5 &
|
||||||
is done by transforming the byte code into a pseudo-2.7 Python
|
2.6 is done by transforming the byte code into a pseudo-2.7 Python
|
||||||
bytecode and is based on code from Eloi Vanderbeken.
|
bytecode and is based on code from Eloi Vanderbeken. A bit of this
|
||||||
|
could have bene easily added by modifying grammar rules.
|
||||||
|
|
||||||
This project, `uncompyle6`, abandons that approach for various
|
This project, `uncompyle6`, abandons that approach for various
|
||||||
reasons. However the main reason is that we need offsets in fragment
|
reasons. Having a grammar per Python version is much cleaner and it
|
||||||
deparsing to be exactly the same, and the transformation process can
|
scales indefinitely. That said, we don't have entire copies of the
|
||||||
remove instructions. _Adding_ instructions with psuedo offsets is
|
grammar, but work off of differences from some neighboring version.
|
||||||
however okay.
|
|
||||||
|
Should there be a desire to rebase or start a new base version to work
|
||||||
|
off of, say for some future Python version, that can be done by
|
||||||
|
dumping a grammar for a specific version after it has been loaded
|
||||||
|
incrementally. You can get a full dump of the grammar by profiling the
|
||||||
|
grammar on a large body of Python source code.
|
||||||
|
|
||||||
|
Another problem with pseudo-2.7 bytecode is that that we need offsets
|
||||||
|
in fragment deparsing to be exactly the same as the bytecode; the
|
||||||
|
transformation process can remove instructions. _Adding_ instructions
|
||||||
|
with psuedo offsets is however okay.
|
||||||
|
|
||||||
`Uncompyle6` however owes its existence to the fork of `uncompyle2` by
|
`Uncompyle6` however owes its existence to the fork of `uncompyle2` by
|
||||||
Myst herie (Mysterie) whose first commit picks up at
|
Myst herie (Mysterie) whose first commit picks up at
|
||||||
@@ -155,25 +169,44 @@ Hartmut a decade an a half ago:
|
|||||||
This project deparses using an Earley-algorithm parse with lots of
|
This project deparses using an Earley-algorithm parse with lots of
|
||||||
massaging of tokens and the grammar in the scanner
|
massaging of tokens and the grammar in the scanner
|
||||||
phase. Earley-algorithm parsers are context free and tend to be linear
|
phase. Earley-algorithm parsers are context free and tend to be linear
|
||||||
if the grammar is LR or left recursive.
|
if the grammar is LR or left recursive. There is a technique for
|
||||||
|
improving LL right recursion, but our parser doesn't have that yet.
|
||||||
|
|
||||||
Another approach that doesn't use grammars is to do something like
|
Another approach to decompiling, and one that doesn't use grammars is
|
||||||
simulate execution symbolically and build expression trees off of
|
to do something like simulate execution symbolically and build
|
||||||
stack results. Control flow in that apprproach still needs to be
|
expression trees off of stack results. Control flow in that approach
|
||||||
handled somewhat ad hoc. The two important projects that work this
|
still needs to be handled somewhat ad hoc. The two important projects
|
||||||
way are [unpyc3](https://code.google.com/p/unpyc3/) and most
|
that work this way are [unpyc3](https://code.google.com/p/unpyc3/) and
|
||||||
especially [pycdc](https://github.com/zrax/pycdc) The latter project
|
most especially [pycdc](https://github.com/zrax/pycdc) The latter
|
||||||
is largely by Michael Hansen and Darryl Pogue. If they supported
|
project is largely by Michael Hansen and Darryl Pogue. If they
|
||||||
getting source-code fragments, did a better job in supporting Python
|
supported getting source-code fragments, did a better job in
|
||||||
more fully, and had a way I could call it from Python, I'd probably
|
supporting Python more fully, and had a way I could call it from
|
||||||
would have ditched this and used that. The code runs blindingly fast
|
Python, I'd probably would have ditched this and used that. The code
|
||||||
and spans all versions of Python, although more recently Python 3
|
runs blindingly fast and spans all versions of Python, although more
|
||||||
support has been lagging.
|
recently Python 3 support has been lagging. The code is impressive for
|
||||||
|
its smallness given that it covers many versions of Python. However, I
|
||||||
|
think it has reached a scalability issue, same as all the other
|
||||||
|
efforts. To handle Python versions more accurately, I think that code
|
||||||
|
base will need to have a lot more code specially which specializes for
|
||||||
|
Python versions. And then it will run into a modularity problem.
|
||||||
|
|
||||||
Tests for the project have been, or are being, culled from all of the
|
Tests for the project have been, or are being, culled from all of the
|
||||||
projects mentioned.
|
projects mentioned. Quite a few have been added to improve grammar
|
||||||
|
coverage and to address the numerous bugs that have been encountered.
|
||||||
|
|
||||||
For a little bit of the history of changes to the Early-algorithm parser,
|
If you think, as I am sure will happen in the future, "hey, I can just
|
||||||
|
write a decompiler from scratch and not have to deal with all all of
|
||||||
|
the complexity here", think again. What is likely to happen is that
|
||||||
|
you'll get at best a 90% solution working for a single Python release
|
||||||
|
that will be obsolete in about a year, and more obsolete each
|
||||||
|
subsequent year. Writing a decompiler for Python gets harder as it
|
||||||
|
Python progresses, so writing one for Python 3.7 isn't as easy as it
|
||||||
|
was for Python 2.2. That said, if you still feel you want to write a
|
||||||
|
single version decompiler, look at the test cases in this project and
|
||||||
|
talk to me. I may have some ideas.
|
||||||
|
|
||||||
|
|
||||||
|
For a little bit of the history of changes to the Earley-algorithm parser,
|
||||||
see the file [NEW-FEATURES.rst](https://github.com/rocky/python-spark/blob/master/NEW-FEATURES.rst) in the [python-spark github repository](https://github.com/rocky/python-spark).
|
see the file [NEW-FEATURES.rst](https://github.com/rocky/python-spark/blob/master/NEW-FEATURES.rst) in the [python-spark github repository](https://github.com/rocky/python-spark).
|
||||||
|
|
||||||
NB. If you find mistakes, want corrections, or want your name added
|
NB. If you find mistakes, want corrections, or want your name added
|
||||||
|
@@ -10,23 +10,36 @@ decompile everything. Overall, I think this one probably does the best
|
|||||||
job of *any* Python decompiler that handles such a wide range of
|
job of *any* Python decompiler that handles such a wide range of
|
||||||
versions.
|
versions.
|
||||||
|
|
||||||
But at any given time, there are maybe dozens of valid Python bytecode
|
But at any given time, there are a number of valid Python bytecode
|
||||||
files that I know of that will cause problems. And when I get through
|
files that I know of that will cause problems. See, for example, the
|
||||||
those and all the issues of decompiler bugs that are currently logged,
|
list in
|
||||||
I could probably easily find dozens more bugs just by doing a
|
[`test/stdlib/runtests.sh`](https://github.com/rocky/python-uncompyle6/blob/master/test/stdlib/runtests.sh).
|
||||||
decompile of all the Python bytecode on any one of my
|
|
||||||
computers. Unless you want to help out by _fixing_ bugs, or are
|
|
||||||
willing to do work by isolating and narrowing bugs, don't feel you are
|
|
||||||
doing me a favor by doing scans on your favorite sets of bytecode
|
|
||||||
files.
|
|
||||||
|
|
||||||
In sum, it is not uncommon that you will find a mistranslation in
|
But I understand: you would the bugs _you_ encounter addressed before
|
||||||
decompiling. Furthermore, you may be expected to do some work in order
|
all the other known bugs.
|
||||||
to have your bug worthy of being considered above other bugs.
|
|
||||||
|
|
||||||
No one is getting paid to work to work on this project, let alone bugs
|
From my standpoint, the good thing about the bugs listed in
|
||||||
you may have an interest in. If you require decompiling bytecode
|
`runtests.sh` is that each test case is small and isolated to a single
|
||||||
immediately, consider using a decompilation service.
|
kind of problem. And I'll tend to fix easier, more isolated cases than
|
||||||
|
generic "something's wrong" kinds of bugs where I'd have to do a bit
|
||||||
|
of work to figure out what's up, if not use some sort of mind reading,
|
||||||
|
make some guesses, and perform some experiments to see if the guesses
|
||||||
|
are correct. I can't read minds, nor am I into guessing games; I'd
|
||||||
|
rather devote the effort spent instead towards fixing bugs that are
|
||||||
|
precisely defined.
|
||||||
|
|
||||||
|
And it often turns out that by just fixing the well-defined and
|
||||||
|
prescribed cases, the ill-defined amorphous cases as well will get
|
||||||
|
handled as well.
|
||||||
|
|
||||||
|
In sum, you may need to do some work to have the bug you have found
|
||||||
|
handled before the hundreds of other bugs, and things I could be
|
||||||
|
doing.
|
||||||
|
|
||||||
|
No one is getting paid to work to work on this project, let alone the
|
||||||
|
bugs you may have an interest in. If you require decompiling bytecode
|
||||||
|
immediately, consider using a decompilation service, listed further
|
||||||
|
down in this document.
|
||||||
|
|
||||||
## Is it really a bug?
|
## Is it really a bug?
|
||||||
|
|
||||||
@@ -40,10 +53,23 @@ obfuscation.
|
|||||||
Checking if bytecode is valid is pretty simple: disassemble the code.
|
Checking if bytecode is valid is pretty simple: disassemble the code.
|
||||||
Python comes with a disassembly module called `dis`. A prerequisite
|
Python comes with a disassembly module called `dis`. A prerequisite
|
||||||
module for this package, `xdis` has a cross-python version
|
module for this package, `xdis` has a cross-python version
|
||||||
disassembler.
|
disassembler called `pydisasm`.
|
||||||
|
|
||||||
### Semantic equivalence vs. exact source code
|
### Semantic equivalence vs. exact source code
|
||||||
|
|
||||||
|
Consider how Python compiles something like "(x*y) + 5". Early on
|
||||||
|
Python creates an "abstract syntax tree" (AST) for this. And this is
|
||||||
|
"abstract" in the sense that unimportant, redundant or unnecceary
|
||||||
|
items have been removed. Here, this means that any notion that you
|
||||||
|
wrote "x+y" in parenthesis is lost, since in this context they are
|
||||||
|
unneeded. Also lost is the fact that the multiplication didn't have
|
||||||
|
spaces around it while the addition did. It should not come as a
|
||||||
|
surprise then that the bytecode which is derived from the AST also has
|
||||||
|
no notion of such possible variation. Generally this kind of thing
|
||||||
|
isn't noticed since the Python community has laid out a very rigid set
|
||||||
|
of formatting guidelines; and it has largely beaten the community into
|
||||||
|
compliance.
|
||||||
|
|
||||||
Almost all versions of Python can perform some sort of code
|
Almost all versions of Python can perform some sort of code
|
||||||
improvement that can't be undone. In earlier versions of Python it is
|
improvement that can't be undone. In earlier versions of Python it is
|
||||||
rare; in later Python versions, it is more common.
|
rare; in later Python versions, it is more common.
|
||||||
@@ -53,7 +79,7 @@ If the code emitted is semantically equivalent, then this isn't a bug.
|
|||||||
|
|
||||||
For example the code might be
|
For example the code might be
|
||||||
|
|
||||||
```
|
```python
|
||||||
if a:
|
if a:
|
||||||
if b:
|
if b:
|
||||||
x = 1
|
x = 1
|
||||||
@@ -61,7 +87,7 @@ if a:
|
|||||||
|
|
||||||
and we might produce:
|
and we might produce:
|
||||||
|
|
||||||
```
|
```python
|
||||||
if a and b:
|
if a and b:
|
||||||
x = 1
|
x = 1
|
||||||
```
|
```
|
||||||
@@ -74,24 +100,35 @@ else:
|
|||||||
|
|
||||||
```
|
```
|
||||||
|
|
||||||
may come out as `elif`.
|
may come out as `elif` or vice versa.
|
||||||
|
|
||||||
|
|
||||||
As mentioned in the README, It is possible that Python changes what
|
As mentioned in the README, It is possible that Python changes what
|
||||||
you write to be more efficient. For example, for:
|
you write to be more efficient. For example, for:
|
||||||
|
|
||||||
|
|
||||||
```
|
```python
|
||||||
if True:
|
if True:
|
||||||
x = 5
|
x = 5
|
||||||
```
|
```
|
||||||
|
|
||||||
Python will generate code like:
|
Python will generate code like:
|
||||||
|
|
||||||
```
|
```python
|
||||||
x = 5
|
x = 5
|
||||||
```
|
```
|
||||||
|
|
||||||
|
Even more extreme, if your code is:
|
||||||
|
|
||||||
|
```python
|
||||||
|
if False:
|
||||||
|
x = 1
|
||||||
|
y = 2
|
||||||
|
# ...
|
||||||
|
```
|
||||||
|
|
||||||
|
Python will eliminate the entire "if" statement.
|
||||||
|
|
||||||
So just because the text isn't the same, does not
|
So just because the text isn't the same, does not
|
||||||
necessarily mean there's a bug.
|
necessarily mean there's a bug.
|
||||||
|
|
||||||
@@ -114,7 +151,7 @@ Also try to narrow the bug. See below.
|
|||||||
Some kind folks also give the invocation they used and the output
|
Some kind folks also give the invocation they used and the output
|
||||||
which usually includes an error message produced. This is
|
which usually includes an error message produced. This is
|
||||||
helpful. From this, I can figure out what OS you are running this on
|
helpful. From this, I can figure out what OS you are running this on
|
||||||
and what version of *uncomplye6* was used. Therefore, if you don't
|
and what version of *uncomplye6* was used. Therefore, if you _don't_
|
||||||
provide the input command and the output from that, please give:
|
provide the input command and the output from that, please give:
|
||||||
|
|
||||||
* _uncompyle6_ version used
|
* _uncompyle6_ version used
|
||||||
@@ -126,7 +163,7 @@ provide the input command and the output from that, please give:
|
|||||||
|
|
||||||
Sure, I get it. No problem. There is Python assembly code on parse
|
Sure, I get it. No problem. There is Python assembly code on parse
|
||||||
errors, so simply by hand decompile that. To get a full disassembly,
|
errors, so simply by hand decompile that. To get a full disassembly,
|
||||||
use pydisasm from the [xdis](https://pypi.python.org/pypi/xdis)
|
use `pydisasm` from the [xdis](https://pypi.python.org/pypi/xdis)
|
||||||
package. Opcodes are described in the documentation for
|
package. Opcodes are described in the documentation for
|
||||||
the [dis](https://docs.python.org/3.6/library/dis.html) module.
|
the [dis](https://docs.python.org/3.6/library/dis.html) module.
|
||||||
|
|
||||||
|
22
LICENSE
22
LICENSE
@@ -1,22 +0,0 @@
|
|||||||
Copyright (c) 2015 by Rocky Bernstein
|
|
||||||
Copyright (c) 2000 by hartmut Goebel <h.goebel@crazy-compilers.com>
|
|
||||||
Copyright (c) 1998-2002 John Aycock
|
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining
|
|
||||||
a copy of this software and associated documentation files (the
|
|
||||||
"Software"), to deal in the Software without restriction, including
|
|
||||||
without limitation the rights to use, copy, modify, merge, publish,
|
|
||||||
distribute, sublicense, and/or sell copies of the Software, and to
|
|
||||||
permit persons to whom the Software is furnished to do so, subject to
|
|
||||||
the following conditions:
|
|
||||||
|
|
||||||
The above copyright notice and this permission notice shall be
|
|
||||||
included in all copies or substantial portions of the Software.
|
|
||||||
|
|
||||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
|
||||||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
|
||||||
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
|
||||||
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
|
||||||
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
|
||||||
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
|
||||||
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
@@ -2,7 +2,7 @@ include README.rst
|
|||||||
include ChangeLog
|
include ChangeLog
|
||||||
include HISTORY.md
|
include HISTORY.md
|
||||||
include HOW-TO-REPORT-A-BUG.md
|
include HOW-TO-REPORT-A-BUG.md
|
||||||
include LICENSE
|
include COPYING
|
||||||
include Makefile
|
include Makefile
|
||||||
include requirements.txt
|
include requirements.txt
|
||||||
include requirements-dev.txt
|
include requirements-dev.txt
|
||||||
|
127
NEWS
127
NEWS
@@ -1,10 +1,123 @@
|
|||||||
|
uncompyle6 3.1.0 2018-03-21 Equinox
|
||||||
|
|
||||||
|
- Add code_deparse_with_offset() fragment function.
|
||||||
|
- Correct paramenter call fragment deparse_code()
|
||||||
|
- Lots of 3.6, 3.x, and 2.7 bug fixes
|
||||||
|
About 5% of 3.6 fail parsing now. But
|
||||||
|
semantics still needs much to be desired.
|
||||||
|
|
||||||
|
uncompyle6 3.0.1 2018-02-17
|
||||||
|
|
||||||
|
- All Python 2.6.9 standard library files weakly verify
|
||||||
|
- Many 3.6 fixes. 84% of the first 200 standard library files weakly compile.
|
||||||
|
One more big push is needed to get the remaining to compile
|
||||||
|
- Many decompilation fixes for other Python versions
|
||||||
|
- Add more to the test framework
|
||||||
|
- And more add tests target previous existing bugs more completely
|
||||||
|
- sync recent license changes in metadata
|
||||||
|
|
||||||
|
uncompyle6 3.0.0 2018-02-17
|
||||||
|
|
||||||
|
- deparse_code() and lookalikes from the various semantic actions are
|
||||||
|
now deprecated. Instead use new API code_deparse() which makes the
|
||||||
|
version optional and bundles debug options into a dictionary.
|
||||||
|
- License changed to GPL3.
|
||||||
|
- Many Python 3.6 fixes, especially around handling EXTENDED_ARGS
|
||||||
|
Due to the reduction in operand size for JUMP's there are many
|
||||||
|
more EXTENDED_ARGS instructions which can be the targets
|
||||||
|
of jumps, and messes up the peephole-like analysis that is
|
||||||
|
done for control flow since we don't have something better in place.
|
||||||
|
- Code has been reorganized to be more instruction nametuple based where it
|
||||||
|
has been more bytecode array based. There was and still is code that had
|
||||||
|
had magic numbers to advance instructions or to pick out operands.
|
||||||
|
- Bug fixes in numerous other Python versions
|
||||||
|
- Instruction display improved
|
||||||
|
- Keep global statements in fixed order (from wangym5106)
|
||||||
|
|
||||||
|
A bit more work is still needed for 3.6 especially in the area of
|
||||||
|
function calls and definitions.
|
||||||
|
|
||||||
|
|
||||||
|
uncompyle6 2.16.0 2018-02-17
|
||||||
|
|
||||||
|
- API additions:
|
||||||
|
- add fragments.op_at_code_loc() and
|
||||||
|
- fragments.deparsed_find()_
|
||||||
|
- Better 2.7 end_if and COME_FROM determination
|
||||||
|
- Fix up 3.6+ CALL_FUNCTION_EX
|
||||||
|
- Misc pydisasm fixes
|
||||||
|
- Weird comprehension bug seen via new loctraceback
|
||||||
|
- Fix Python 3.5+ CALL_FUNCTION_VAR and BUILD_LIST_UNPACK in call; with this
|
||||||
|
we can can handle 3.5+ f(a, b, *c, *d, *e) now
|
||||||
|
|
||||||
|
uncompyle6 2.15.1 2018-02-05
|
||||||
|
|
||||||
|
- More bug fixes and revert an improper bug fix in 2.15.0
|
||||||
|
|
||||||
|
uncompyle6 2.15.0 2018-02-05 pycon2018.co
|
||||||
|
|
||||||
|
- Bug fixes
|
||||||
|
- Code fragment improvements
|
||||||
|
- Code cleanups
|
||||||
|
- Expand testing
|
||||||
|
|
||||||
|
uncompyle6 2.15.1 2018-01-27
|
||||||
|
|
||||||
|
- Add --linemap option to give line correspondences
|
||||||
|
between original source lines and reconstructed line sources.
|
||||||
|
It is far from perfect, but it is a start
|
||||||
|
- Add a new class of tests: tests which when decompiled check themselves
|
||||||
|
- Split off Python version semantic action customizations into its own file
|
||||||
|
- Fix 2.7 bug in ifelse loop statement
|
||||||
|
- Handle 3.6+ EXTENDED_ARGs for POP_JUMP_IF... instructions
|
||||||
|
- Correct 3.6+ calls with kwargs
|
||||||
|
- Describe the difficulty of 3.6 in README
|
||||||
|
|
||||||
|
uncompyle6 2.14.3 2018-01-19
|
||||||
|
|
||||||
|
- Fix bug in 3.5+ await stmt
|
||||||
|
- Better version to magic handling; handle 3.5.2 .. 3.5.4 versions
|
||||||
|
- Improve/correct test_pyenvlib.py status messages
|
||||||
|
- Fix some 2.7 and 2.6 parser bugs
|
||||||
|
- Fix whilelse parsing bugs
|
||||||
|
- Correct 2.5- decorator parsing
|
||||||
|
- grammar for decorators matches AST a little more
|
||||||
|
- better tests in setup.py for running the right version of Python
|
||||||
|
- Fix 2.6- parsing of "for .. try/else" ... with "continue" inside
|
||||||
|
|
||||||
|
uncompyle6 2.14.2 2018-01-09 Samish
|
||||||
|
|
||||||
|
Decompilation bug fixes, mostly 3.6 and pre 2.7
|
||||||
|
|
||||||
|
- 3.6 FUNCTION_EX (somewhat)
|
||||||
|
- 3.6 FUNCTION_EX_KW fixes
|
||||||
|
- 3.6 MAKE_FUNCTION fixes
|
||||||
|
- correct 3.5 CALL_FUNCTION_VAR
|
||||||
|
- stronger 3.x "while 1" testing
|
||||||
|
- Fix bug in if's with "pass" bodies. Fixes #104
|
||||||
|
- try/else and try/finally fixes on 2.6-
|
||||||
|
- limit pypy customization to pypy
|
||||||
|
- Add addr fields in COME_FROMS
|
||||||
|
- Allow use of full instructions in parser reduction routines
|
||||||
|
- Reduce grammar in Python 3 by specialization more to specific
|
||||||
|
Python versions
|
||||||
|
- Match Python AST names more closely when possible
|
||||||
|
|
||||||
|
uncompyle6 2.14.1 2017-12-10 Dr. Gecko
|
||||||
|
|
||||||
|
- Many decompilation bugfixes
|
||||||
|
- Grammar rule reduction and version isolation
|
||||||
|
- Match higher-level nonterminal names more closely
|
||||||
|
with Python AST
|
||||||
|
- Start automated Python stdlib testing - full round trip
|
||||||
|
|
||||||
uncompyle6 2.14.0 2017-11-26 johnnybamazing
|
uncompyle6 2.14.0 2017-11-26 johnnybamazing
|
||||||
|
|
||||||
- Start to isolate grammar rules between versions
|
- Start to isolate grammar rules between versions
|
||||||
and remove used grammar rules
|
and remove used grammar rules
|
||||||
- Fix a number of bytecode decompile problems
|
- Fix a number of bytecode decompile problems
|
||||||
(many more remain)
|
(many more remain)
|
||||||
- Add stdlib/runtests.sh for even more rigourous testing
|
- Add stdlib/runtests.sh for even more rigorous testing
|
||||||
|
|
||||||
uncompyle6 2.13.3 2017-11-13
|
uncompyle6 2.13.3 2017-11-13
|
||||||
|
|
||||||
@@ -28,7 +141,7 @@ Overall: better 3.6 decompiling and some much needed code refactoring and cleanu
|
|||||||
added to assist here. Ignoring errors may be okay because the fragment parser often just needs,
|
added to assist here. Ignoring errors may be okay because the fragment parser often just needs,
|
||||||
well, *fragments*.
|
well, *fragments*.
|
||||||
- Distinguish RETURN_VALUE from RETURN_END_IF in exception bodies better in 3.6
|
- Distinguish RETURN_VALUE from RETURN_END_IF in exception bodies better in 3.6
|
||||||
- bug in 3.x language changes: import queue va import Queue
|
- bug in 3.x language changes: import queue via import Queue
|
||||||
- reinstate some bytecode tests since decompiling has gotten better
|
- reinstate some bytecode tests since decompiling has gotten better
|
||||||
- Revise how to report a bug
|
- Revise how to report a bug
|
||||||
|
|
||||||
@@ -63,8 +176,8 @@ uncompyle6 2.11.4 2017-08-15
|
|||||||
|
|
||||||
* scanner and parser now allow 3-part version string lookups,
|
* scanner and parser now allow 3-part version string lookups,
|
||||||
e.g. 2.7.1 We allow a float here, but if passed a string like '2.7'. or
|
e.g. 2.7.1 We allow a float here, but if passed a string like '2.7'. or
|
||||||
* unpin 3.5.1. xdis 3.5.4 has been releasd and fixes the problems we had. Use that.
|
* unpin 3.5.1. xdis 3.5.4 has been release and fixes the problems we had. Use that.
|
||||||
* some routnes here moved to xdis. Use the xdis version
|
* some routines here moved to xdis. Use the xdis version
|
||||||
* README.rst: Link typo Name is trepan2 now not trepan
|
* README.rst: Link typo Name is trepan2 now not trepan
|
||||||
* xdis-forced change adjust for COMPARE_OP "is-not" in
|
* xdis-forced change adjust for COMPARE_OP "is-not" in
|
||||||
semanatic routines. We need "is not".
|
semanatic routines. We need "is not".
|
||||||
@@ -160,9 +273,9 @@ uncompyle6 2.9.8 2016-12-16
|
|||||||
- fix bug in --verify option
|
- fix bug in --verify option
|
||||||
- DRY (a little) control-flow detection
|
- DRY (a little) control-flow detection
|
||||||
- fix syntax in tuples with one element
|
- fix syntax in tuples with one element
|
||||||
- if AST rule inheritence in Python 2.5
|
- if AST rule inheritance in Python 2.5
|
||||||
- NAME_MODULE removal for Python <= 2.4
|
- NAME_MODULE removal for Python <= 2.4
|
||||||
- verifycall fixes for Python <= 2.4
|
- verify call fixes for Python <= 2.4
|
||||||
- more Python lint
|
- more Python lint
|
||||||
|
|
||||||
uncompyle6 2.9.7 2016-12-16
|
uncompyle6 2.9.7 2016-12-16
|
||||||
@@ -198,7 +311,7 @@ uncompyle6 2.9.6 2016-11-20
|
|||||||
in the results.
|
in the results.
|
||||||
- better control flow debugging output
|
- better control flow debugging output
|
||||||
- Python 2 and 3 detect structure code is more similar
|
- Python 2 and 3 detect structure code is more similar
|
||||||
- Handle Docstrings with embedded tiple quotes (""")
|
- Handle Docstrings with embedded triple quotes (""")
|
||||||
|
|
||||||
uncompyle6 2.9.5 2016-11-13
|
uncompyle6 2.9.5 2016-11-13
|
||||||
|
|
||||||
|
124
README.rst
124
README.rst
@@ -3,7 +3,7 @@
|
|||||||
uncompyle6
|
uncompyle6
|
||||||
==========
|
==========
|
||||||
|
|
||||||
A native Python cross-version Decompiler and Fragment Decompiler.
|
A native Python cross-version decompiler and fragment decompiler.
|
||||||
The successor to decompyle, uncompyle, and uncompyle2.
|
The successor to decompyle, uncompyle, and uncompyle2.
|
||||||
|
|
||||||
|
|
||||||
@@ -17,43 +17,57 @@ source code. It accepts bytecodes from Python version 1.5, and 2.1 to
|
|||||||
Why this?
|
Why this?
|
||||||
---------
|
---------
|
||||||
|
|
||||||
There were a number of decompyle, uncompyle, uncompyle2, uncompyle3
|
Ok, I'll say it: this software is amazing. It is more than your
|
||||||
forks around. All of them came basically from the same code base, and
|
normal hacky decompiler. Using compiler_ technology, the program
|
||||||
almost all of them no were no longer actively maintained. Only one
|
creates a parse tree of the program from the instructions; nodes at
|
||||||
handled Python 3, and even there, only 3.2 or 3.3 depending on which
|
the upper levels that look a little like what might come from a Python
|
||||||
code is used. This code pulls these together and moves forward.
|
AST. So we can really classify and understand what's going on in
|
||||||
|
sections of Python bytecode.
|
||||||
|
|
||||||
|
Building on this, another thing that makes this different from other
|
||||||
|
CPython bytecode decompilers is the ability to deparse just
|
||||||
|
*fragments* of source code and give source-code information around a
|
||||||
|
given bytecode offset.
|
||||||
|
|
||||||
|
I use the tree fragments to deparse fragments of code inside my
|
||||||
|
trepan_ debuggers_. For that, bytecode offsets are recorded and
|
||||||
|
associated with fragments of the source code. This purpose, although
|
||||||
|
compatible with the original intention, is yet a little bit different.
|
||||||
|
See this_ for more information.
|
||||||
|
|
||||||
|
Python fragment deparsing given an instruction offset is useful in
|
||||||
|
showing stack traces and can be encorporated into any program that
|
||||||
|
wants to show a location in more detail than just a line number at
|
||||||
|
runtime. This code can be also used when source-code information does
|
||||||
|
not exist and there is just bytecode. Again, my debuggers make use of
|
||||||
|
this.
|
||||||
|
|
||||||
|
There were (and still are) a number of decompyle, uncompyle,
|
||||||
|
uncompyle2, uncompyle3 forks around. Almost all of them come basically
|
||||||
|
from the same code base, and (almost?) all of them are no longer
|
||||||
|
actively maintained. One was really good at decompiling Python 1.5-2.3
|
||||||
|
or so, another really good at Python 2.7, but that only. Another
|
||||||
|
handles Python 3.2 only; another patched that and handled only 3.3.
|
||||||
|
You get the idea. This code pulls all of these forks together and
|
||||||
|
*moves forward*. There is some serious refactoring and cleanup in this
|
||||||
|
code base over those old forks.
|
||||||
|
|
||||||
This project has the most complete support for Python 3.3 and above
|
This project has the most complete support for Python 3.3 and above
|
||||||
and the best all-around Pythoin support.
|
and the best all-around Python support.
|
||||||
|
|
||||||
We are serious about testing, and use automated processes to find
|
We are serious about testing, and use automated processes to find
|
||||||
bugs. In the issue trackers for other decompilers, you will find a
|
bugs. In the issue trackers for other decompilers, you will find a
|
||||||
number of bugs we've found along the way. Very few to none of them are
|
number of bugs we've found along the way. Very few to none of them are
|
||||||
not fixed in the other decompilers.
|
fixed in the other decompilers.
|
||||||
|
|
||||||
Another thing that makes this different from other CPython bytecode
|
|
||||||
decompilers is the ability to deparse just fragments and give
|
|
||||||
source-code information around a given bytecode offset.
|
|
||||||
|
|
||||||
I use this to deparse fragments of code inside my trepan_
|
|
||||||
debuggers_. For that, I need to record text fragments for all
|
|
||||||
bytecode offsets (of interest). This purpose although largely
|
|
||||||
compatible with the original intention is yet a little bit different.
|
|
||||||
See this_ for more information.
|
|
||||||
|
|
||||||
The idea of Python fragment deparsing given an instruction offset can
|
|
||||||
be used in showing stack traces or any program that wants to show a
|
|
||||||
location in more detail than just a line number. It can be also used
|
|
||||||
when source-code information does not exist and there is just bytecode
|
|
||||||
information.
|
|
||||||
|
|
||||||
Requirements
|
Requirements
|
||||||
------------
|
------------
|
||||||
|
|
||||||
This project requires Python 2.6 or later, PyPy 3-2.4, or PyPy-5.0.1.
|
The code here can be run on Python versions 2.6 or later, PyPy 3-2.4,
|
||||||
Python versions 2.4-2.7 are supported in the python-2.4 branch.
|
or PyPy-5.0.1. Python versions 2.4-2.7 are supported in the
|
||||||
The bytecode files it can read has been tested on Python bytecodes from
|
python-2.4 branch. The bytecode files it can read have been tested on
|
||||||
versions 1.5, 2.1-2.7, and 3.0-3.6 and the above-mentioned PyPy versions.
|
Python bytecodes from versions 1.5, 2.1-2.7, and 3.0-3.6 and the
|
||||||
|
above-mentioned PyPy versions.
|
||||||
|
|
||||||
Installation
|
Installation
|
||||||
------------
|
------------
|
||||||
@@ -62,11 +76,9 @@ This uses setup.py, so it follows the standard Python routine:
|
|||||||
|
|
||||||
::
|
::
|
||||||
|
|
||||||
pip install -e .
|
pip install -e . # set up to run from source tree
|
||||||
pip install -r requirements-dev.txt
|
# Or if you want to install instead
|
||||||
python setup.py install # may need sudo
|
python setup.py install # may need sudo
|
||||||
# or if you have pyenv:
|
|
||||||
python setup.py develop
|
|
||||||
|
|
||||||
A GNU makefile is also provided so :code:`make install` (possibly as root or
|
A GNU makefile is also provided so :code:`make install` (possibly as root or
|
||||||
sudo) will do the steps above.
|
sudo) will do the steps above.
|
||||||
@@ -116,13 +128,13 @@ Known Bugs/Restrictions
|
|||||||
|
|
||||||
The biggest known and possibly fixable (but hard) problem has to do
|
The biggest known and possibly fixable (but hard) problem has to do
|
||||||
with handling control flow. (Python has probably the most diverse and
|
with handling control flow. (Python has probably the most diverse and
|
||||||
screwy set of compound statements I've ever seen; a number of the
|
screwy set of compound statements I've ever seen; there
|
||||||
usual ones like else clauses on loops and try blocks I suspect most
|
are "else" clauses on loops and try blocks that I suspect many
|
||||||
programmers don't know aobut.)
|
programmers don't know about.)
|
||||||
|
|
||||||
All of the Python decompilers I have looked at have the same
|
All of the Python decompilers that I have looked at have problems
|
||||||
problem. In some cases we can detect an erroneous decompilation and
|
decompiling Python's control flow. In some cases we can detect an
|
||||||
report that.
|
erroneous decompilation and report that.
|
||||||
|
|
||||||
*Verification* is the process of decompiling bytecode, compiling with
|
*Verification* is the process of decompiling bytecode, compiling with
|
||||||
a Python for that bytecode version, and then comparing the bytecode
|
a Python for that bytecode version, and then comparing the bytecode
|
||||||
@@ -151,19 +163,22 @@ python 2.3-2.4 since a lot of the goodness of early the version of the
|
|||||||
decompiler from that era has been preserved (and Python compilation in
|
decompiler from that era has been preserved (and Python compilation in
|
||||||
that era was minimal)
|
that era was minimal)
|
||||||
|
|
||||||
Later distributions average about 200 files. There is some work to do
|
There is some work to do on the lower end Python versions which is
|
||||||
on the lower end Python versions which is more difficult for us to
|
more difficult for us to handle since we don't have a Python
|
||||||
handle since we don't have a Python interpreter for versions 1.5, 1.6,
|
interpreter for versions 1.5, 1.6, and 2.0.
|
||||||
and 2.0.
|
|
||||||
|
|
||||||
In the Python 3 series, Python support is is strongest around 3.4 or
|
In the Python 3 series, Python support is is strongest around 3.4 or
|
||||||
3.3 and drops off as you move further away from those versions. Python
|
3.3 and drops off as you move further away from those versions. Python
|
||||||
3.6 changes things drastically by using word codes rather than byte
|
3.6 changes things drastically by using word codes rather than byte
|
||||||
codes. That has been addressed, but then it also changes function call
|
codes. As a result, the jump offset field in a jump instruction
|
||||||
opcodes and its semantics and has more problems with control flow than
|
argument has been reduced. This makes the `EXTENDED_ARG` instructions
|
||||||
3.5 has. Between Python 3.5, 3.6 and 3.7 there have been major changes
|
are now more prevalent in jump instruction; previously they had been
|
||||||
to the `MAKE_FUNCTION` and `CALL_FUNCTION` instructions. Those are
|
rare. Perhaps to compensate for the additional `EXTENDED_ARG`
|
||||||
not handled yet.
|
instructions, additional jump optimization has been added. So in sum
|
||||||
|
handling control flow by ad hoc means as is currently done is worse.
|
||||||
|
|
||||||
|
Also, between Python 3.5, 3.6 and 3.7 there have been major changes to the
|
||||||
|
`MAKE_FUNCTION` and `CALL_FUNCTION` instructions.
|
||||||
|
|
||||||
Currently not all Python magic numbers are supported. Specifically in
|
Currently not all Python magic numbers are supported. Specifically in
|
||||||
some versions of Python, notably Python 3.6, the magic number has
|
some versions of Python, notably Python 3.6, the magic number has
|
||||||
@@ -175,10 +190,12 @@ handled.
|
|||||||
|
|
||||||
We also don't handle PJOrion_ obfuscated code. For that try: PJOrion
|
We also don't handle PJOrion_ obfuscated code. For that try: PJOrion
|
||||||
Deobfuscator_ to unscramble the bytecode to get valid bytecode before
|
Deobfuscator_ to unscramble the bytecode to get valid bytecode before
|
||||||
trying this tool.
|
trying this tool. This program can't decompile Microsoft Windows EXE
|
||||||
|
files created by Py2EXE_, although we can probably decompile the code
|
||||||
Handling pathologically long lists of expressions or statements is
|
after you extract the bytecode properly. For situations like this, you
|
||||||
slow.
|
might want to consider a decompilation service like `Crazy Compilers
|
||||||
|
<http://www.crazy-compilers.com/decompyle/>`_. Handling
|
||||||
|
pathologically long lists of expressions or statements is slow.
|
||||||
|
|
||||||
|
|
||||||
There is lots to do, so please dig in and help.
|
There is lots to do, so please dig in and help.
|
||||||
@@ -188,14 +205,16 @@ See Also
|
|||||||
|
|
||||||
* https://github.com/zrax/pycdc : supports all versions of Python and is written in C++. Support for later Python 3 versions is a bit lacking though.
|
* https://github.com/zrax/pycdc : supports all versions of Python and is written in C++. Support for later Python 3 versions is a bit lacking though.
|
||||||
* https://code.google.com/archive/p/unpyc3/ : supports Python 3.2 only. The above projects use a different decompiling technique than what is used here.
|
* https://code.google.com/archive/p/unpyc3/ : supports Python 3.2 only. The above projects use a different decompiling technique than what is used here.
|
||||||
* https://github.com/figment/unpyc3/ : fork of above, but supports Python 3.3 only. Include some fixes like supporting function annotations
|
* https://github.com/figment/unpyc3/ : fork of above, but supports Python 3.3 only. Includes some fixes like supporting function annotations
|
||||||
* The HISTORY_ file.
|
* The HISTORY_ file.
|
||||||
* `How to report a bug <https://github.com/rocky/python-uncompyle6/blob/master/HOW-TO-REPORT-A-BUG.md>`_
|
* `How to report a bug <https://github.com/rocky/python-uncompyle6/blob/master/HOW-TO-REPORT-A-BUG.md>`_
|
||||||
* https://github.com/rocky/python-xdis : Cross Python version disassembler
|
* https://github.com/rocky/python-xdis : Cross Python version disassembler
|
||||||
* https://github.com/rocky/python-xasm : Cross Python version assembler
|
* https://github.com/rocky/python-xasm : Cross Python version assembler
|
||||||
|
* https://github.com/rocky/python-uncompyle6/wiki : Wiki Documents which describe the code and aspects of it in more detail
|
||||||
|
|
||||||
|
|
||||||
.. _trepan: https://pypi.python.org/pypi/trepan2
|
.. _trepan: https://pypi.python.org/pypi/trepan2
|
||||||
|
.. _compiler: https://pypi.python.org/pypi/spark_parser
|
||||||
.. _HISTORY: https://github.com/rocky/python-uncompyle6/blob/master/HISTORY.md
|
.. _HISTORY: https://github.com/rocky/python-uncompyle6/blob/master/HISTORY.md
|
||||||
.. _debuggers: https://pypi.python.org/pypi/trepan3k
|
.. _debuggers: https://pypi.python.org/pypi/trepan3k
|
||||||
.. _remake: https://bashdb.sf.net/remake
|
.. _remake: https://bashdb.sf.net/remake
|
||||||
@@ -205,3 +224,4 @@ See Also
|
|||||||
:target: https://travis-ci.org/rocky/python-uncompyle6
|
:target: https://travis-ci.org/rocky/python-uncompyle6
|
||||||
.. _PJOrion: http://www.koreanrandom.com/forum/topic/15280-pjorion-%D1%80%D0%B5%D0%B4%D0%B0%D0%BA%D1%82%D0%B8%D1%80%D0%BE%D0%B2%D0%B0%D0%BD%D0%B8%D0%B5-%D0%BA%D0%BE%D0%BC%D0%BF%D0%B8%D0%BB%D1%8F%D1%86%D0%B8%D1%8F-%D0%B4%D0%B5%D0%BA%D0%BE%D0%BC%D0%BF%D0%B8%D0%BB%D1%8F%D1%86%D0%B8%D1%8F-%D0%BE%D0%B1%D1%84
|
.. _PJOrion: http://www.koreanrandom.com/forum/topic/15280-pjorion-%D1%80%D0%B5%D0%B4%D0%B0%D0%BA%D1%82%D0%B8%D1%80%D0%BE%D0%B2%D0%B0%D0%BD%D0%B8%D0%B5-%D0%BA%D0%BE%D0%BC%D0%BF%D0%B8%D0%BB%D1%8F%D1%86%D0%B8%D1%8F-%D0%B4%D0%B5%D0%BA%D0%BE%D0%BC%D0%BF%D0%B8%D0%BB%D1%8F%D1%86%D0%B8%D1%8F-%D0%BE%D0%B1%D1%84
|
||||||
.. _Deobfuscator: https://github.com/extremecoders-re/PjOrion-Deobfuscator
|
.. _Deobfuscator: https://github.com/extremecoders-re/PjOrion-Deobfuscator
|
||||||
|
.. _Py2EXE: https://en.wikipedia.org/wiki/Py2exe
|
||||||
|
@@ -1,3 +1,17 @@
|
|||||||
|
# Copyright (C) 2018 Rocky Bernstein <rocky@gnu.org>
|
||||||
|
#
|
||||||
|
# This program is free software: you can redistribute it and/or modify
|
||||||
|
# it under the terms of the GNU General Public License as published by
|
||||||
|
# the Free Software Foundation, either version 3 of the License, or
|
||||||
|
# (at your option) any later version.
|
||||||
|
#
|
||||||
|
# This program is distributed in the hope that it will be useful,
|
||||||
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
# GNU General Public License for more details.
|
||||||
|
#
|
||||||
|
# You should have received a copy of the GNU General Public License
|
||||||
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
"""uncompyle6 packaging information"""
|
"""uncompyle6 packaging information"""
|
||||||
|
|
||||||
# To the extent possible we make this file look more like a
|
# To the extent possible we make this file look more like a
|
||||||
@@ -9,23 +23,23 @@
|
|||||||
|
|
||||||
# Things that change more often go here.
|
# Things that change more often go here.
|
||||||
copyright = """
|
copyright = """
|
||||||
Copyright (C) 2015-2017 Rocky Bernstein <rb@dustyfeet.com>.
|
Copyright (C) 2015-2018 Rocky Bernstein <rb@dustyfeet.com>.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
classifiers = ['Development Status :: 5 - Production/Stable',
|
classifiers = ['Development Status :: 5 - Production/Stable',
|
||||||
'Intended Audience :: Developers',
|
'Intended Audience :: Developers',
|
||||||
|
'License :: OSI Approved :: GNU General Public License v3 (GPLv3)',
|
||||||
'Operating System :: OS Independent',
|
'Operating System :: OS Independent',
|
||||||
'Programming Language :: Python',
|
'Programming Language :: Python',
|
||||||
'Programming Language :: Python :: 2.4',
|
'Programming Language :: Python :: 2.4',
|
||||||
'Programming Language :: Python :: 2.5',
|
'Programming Language :: Python :: 2.5',
|
||||||
'Programming Language :: Python :: 2.6',
|
'Programming Language :: Python :: 2.6',
|
||||||
'Programming Language :: Python :: 2.7',
|
'Programming Language :: Python :: 2.7',
|
||||||
'Programming Language :: Python :: 3.1',
|
|
||||||
'Programming Language :: Python :: 3.2',
|
|
||||||
'Programming Language :: Python :: 3.3',
|
'Programming Language :: Python :: 3.3',
|
||||||
'Programming Language :: Python :: 3.4',
|
'Programming Language :: Python :: 3.4',
|
||||||
'Programming Language :: Python :: 3.5',
|
'Programming Language :: Python :: 3.5',
|
||||||
'Programming Language :: Python :: 3.6',
|
'Programming Language :: Python :: 3.6',
|
||||||
|
'Programming Language :: Python :: 3.7',
|
||||||
'Topic :: Software Development :: Debuggers',
|
'Topic :: Software Development :: Debuggers',
|
||||||
'Topic :: Software Development :: Libraries :: Python Modules',
|
'Topic :: Software Development :: Libraries :: Python Modules',
|
||||||
]
|
]
|
||||||
@@ -39,13 +53,13 @@ entry_points = {
|
|||||||
'pydisassemble=uncompyle6.bin.pydisassemble:main',
|
'pydisassemble=uncompyle6.bin.pydisassemble:main',
|
||||||
]}
|
]}
|
||||||
ftp_url = None
|
ftp_url = None
|
||||||
install_requires = ['spark-parser >= 1.8.0, < 1.9.0',
|
install_requires = ['spark-parser >= 1.8.5, < 1.9.0',
|
||||||
'xdis >= 3.6.1, < 3.7.0']
|
'xdis >= 3.7.0, < 3.8.0']
|
||||||
license = 'MIT'
|
license = 'GPL3'
|
||||||
mailing_list = 'python-debugger@googlegroups.com'
|
mailing_list = 'python-debugger@googlegroups.com'
|
||||||
modname = 'uncompyle6'
|
modname = 'uncompyle6'
|
||||||
py_modules = None
|
py_modules = None
|
||||||
short_desc = 'Python cross-version byte-code deparser'
|
short_desc = 'Python cross-version byte-code decompiler'
|
||||||
web = 'https://github.com/rocky/python-uncompyle6/'
|
web = 'https://github.com/rocky/python-uncompyle6/'
|
||||||
|
|
||||||
# tracebacks in zip files are funky and not debuggable
|
# tracebacks in zip files are funky and not debuggable
|
||||||
|
@@ -13,8 +13,6 @@ if ! source ./setup-python-2.4.sh ; then
|
|||||||
exit $?
|
exit $?
|
||||||
fi
|
fi
|
||||||
|
|
||||||
PYVERSIONS='2.7.14 2.6.9 3.3.6 3.4.2 3.5.4 3.6.3'
|
|
||||||
|
|
||||||
cd ..
|
cd ..
|
||||||
for version in $PYVERSIONS; do
|
for version in $PYVERSIONS; do
|
||||||
if ! pyenv local $version ; then
|
if ! pyenv local $version ; then
|
||||||
|
@@ -2,9 +2,9 @@
|
|||||||
**Table of Contents**
|
**Table of Contents**
|
||||||
|
|
||||||
- [Get latest sources:](#get-latest-sources)
|
- [Get latest sources:](#get-latest-sources)
|
||||||
- [Change version in uncompyle6/version.py. Then:](#change-version-in-uncompyle6versionpy-then)
|
- [Change version in uncompyle6/version.py](#change-version-in-uncompyle6versionpy)
|
||||||
- [Update ChangeLog:](#update-changelog)
|
- [Update ChangeLog:](#update-changelog)
|
||||||
- [Update NEWS from ChangeLog. Then:](#update-news-from-changelog-then)
|
- [Update NEWS from ChangeLog:](#update-news-from-changelog)
|
||||||
- [Make sure pyenv is running and check newer versions](#make-sure-pyenv-is-running-and-check-newer-versions)
|
- [Make sure pyenv is running and check newer versions](#make-sure-pyenv-is-running-and-check-newer-versions)
|
||||||
- [Switch to python-2.4, sync that up and build that first since it creates a tarball which we don't want.](#switch-to-python-24-sync-that-up-and-build-that-first-since-it-creates-a-tarball-which-we-dont-want)
|
- [Switch to python-2.4, sync that up and build that first since it creates a tarball which we don't want.](#switch-to-python-24-sync-that-up-and-build-that-first-since-it-creates-a-tarball-which-we-dont-want)
|
||||||
- [Update NEWS from master branch](#update-news-from-master-branch)
|
- [Update NEWS from master branch](#update-news-from-master-branch)
|
||||||
@@ -17,11 +17,11 @@
|
|||||||
<!-- markdown-toc end -->
|
<!-- markdown-toc end -->
|
||||||
# Get latest sources:
|
# Get latest sources:
|
||||||
|
|
||||||
$ . ./admin-tool/update-sources.sh
|
git pull
|
||||||
|
|
||||||
# Change version in uncompyle6/version.py. Then:
|
# Change version in uncompyle6/version.py:
|
||||||
|
|
||||||
$ emacs uncompyle6/version.py
|
$ emacs uncompyle6/version.py
|
||||||
$ source uncompyle6/version.py
|
$ source uncompyle6/version.py
|
||||||
$ echo $VERSION
|
$ echo $VERSION
|
||||||
$ git commit -m"Get ready for release $VERSION" .
|
$ git commit -m"Get ready for release $VERSION" .
|
||||||
@@ -30,9 +30,9 @@
|
|||||||
|
|
||||||
$ make ChangeLog
|
$ make ChangeLog
|
||||||
|
|
||||||
# Update NEWS from ChangeLog. Then:
|
# Update NEWS from ChangeLog:
|
||||||
|
|
||||||
$ emacs NEWS
|
$ emacs NEWS
|
||||||
$ make check
|
$ make check
|
||||||
$ git commit --amend .
|
$ git commit --amend .
|
||||||
$ git push # get CI testing going early
|
$ git push # get CI testing going early
|
||||||
@@ -44,25 +44,20 @@
|
|||||||
# Switch to python-2.4, sync that up and build that first since it creates a tarball which we don't want.
|
# Switch to python-2.4, sync that up and build that first since it creates a tarball which we don't want.
|
||||||
|
|
||||||
$ source admin-tools/setup-python-2.4.sh
|
$ source admin-tools/setup-python-2.4.sh
|
||||||
$ rm ChangeLog
|
$ git merge master
|
||||||
|
# Add and fix merge conflicts
|
||||||
|
$ git commit
|
||||||
|
|
||||||
# $ git merge master ?
|
# Check against older versions
|
||||||
|
|
||||||
# Update NEWS from master branch
|
|
||||||
|
|
||||||
$ git commit -m"Get ready for release $VERSION" .
|
|
||||||
|
|
||||||
# Check against all versions
|
|
||||||
|
|
||||||
$ source admin-tools/check-older-versions.sh
|
$ source admin-tools/check-older-versions.sh
|
||||||
$ source admin-tools/check-newer-versions.sh
|
|
||||||
|
|
||||||
# Make packages and tag
|
# Make packages and tag
|
||||||
|
|
||||||
$ admin-tools/make-dist-older.sh
|
$ . ./admin-tools/make-dist-older.sh
|
||||||
$ git tag release-python-2.4-$VERSION
|
$ git tag release-python-2.4-$VERSION
|
||||||
|
|
||||||
$ admin-tools/make-dist-newer.sh
|
$ . ./admin-tools/make-dist-newer.sh
|
||||||
$ git tag release-$VERSION
|
$ git tag release-$VERSION
|
||||||
|
|
||||||
# Upload single package and look at Rst Formating
|
# Upload single package and look at Rst Formating
|
||||||
|
19
admin-tools/pyenv-all-versions
Normal file
19
admin-tools/pyenv-all-versions
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
# -*- shell-script -*-
|
||||||
|
# Sets PYVERSIONS to be all pyenv versions we have
|
||||||
|
if [[ $0 == ${BASH_SOURCE[0]} ]] ; then
|
||||||
|
echo "This script should be *sourced* rather than run directly through bash"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
olddir=$(pwd)
|
||||||
|
mydir=$(dirname ${BASH_SOURCE[0]})
|
||||||
|
cd $mydir
|
||||||
|
|
||||||
|
all=""
|
||||||
|
for file in pyenv-{olde{st,r},newer}-versions ; do
|
||||||
|
. $mydir/$file
|
||||||
|
all="$all $PYVERSIONS"
|
||||||
|
done
|
||||||
|
|
||||||
|
PYVERSIONS="$all"
|
||||||
|
cd $olddir
|
@@ -1,6 +1,8 @@
|
|||||||
# -*- shell-script -*-
|
# -*- shell-script -*-
|
||||||
|
# Sets PYVERSIONS to be pyenv versions that
|
||||||
|
# we can use in the master branch.
|
||||||
if [[ $0 == ${BASH_SOURCE[0]} ]] ; then
|
if [[ $0 == ${BASH_SOURCE[0]} ]] ; then
|
||||||
echo "This script should be *sourced* rather than run directly through bash"
|
echo "This script should be *sourced* rather than run directly through bash"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
export PYVERSIONS='3.5.2 3.6.2 2.6.9 3.3.6 2.7.14 3.4.2'
|
export PYVERSIONS='3.5.5 3.6.4 2.6.9 3.3.7 2.7.14 3.4.8'
|
||||||
|
@@ -1,4 +1,7 @@
|
|||||||
# -*- shell-script -*-
|
# -*- shell-script -*-
|
||||||
|
# Sets PYVERSIONS to be pyenv versions that
|
||||||
|
# we can use in the python-2.4 branch.
|
||||||
|
|
||||||
if [[ $0 == ${BASH_SOURCE[0]} ]] ; then
|
if [[ $0 == ${BASH_SOURCE[0]} ]] ; then
|
||||||
echo "This script should be *sourced* rather than run directly through bash"
|
echo "This script should be *sourced* rather than run directly through bash"
|
||||||
exit 1
|
exit 1
|
||||||
|
9
admin-tools/pyenv-oldest-versions
Normal file
9
admin-tools/pyenv-oldest-versions
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
# -*- shell-script -*-
|
||||||
|
# Sets PYVERSIONS to be all pyenv the oldest versions we have.
|
||||||
|
# These are not covered (yet) by uncompyle6, although
|
||||||
|
# some programs do work here.
|
||||||
|
if [[ $0 == ${BASH_SOURCE[0]} ]] ; then
|
||||||
|
echo "This script should be *sourced* rather than run directly through bash"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
export PYVERSIONS='2.1.3 2.2.3 2.3.7'
|
28
admin-tools/run-pyenvlib-test-all.sh
Executable file
28
admin-tools/run-pyenvlib-test-all.sh
Executable file
@@ -0,0 +1,28 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
# Runs test_pyenvlib.test on all versions of Python master.
|
||||||
|
function finish {
|
||||||
|
cd $owd
|
||||||
|
}
|
||||||
|
|
||||||
|
# FIXME put some of the below in a common routine
|
||||||
|
owd=$(pwd)
|
||||||
|
trap finish EXIT
|
||||||
|
|
||||||
|
cd $(dirname ${BASH_SOURCE[0]})
|
||||||
|
if ! source ./pyenv-newer-versions ; then
|
||||||
|
exit $?
|
||||||
|
fi
|
||||||
|
if ! source ./setup-master.sh ; then
|
||||||
|
exit $?
|
||||||
|
fi
|
||||||
|
cd ../test
|
||||||
|
for version in $PYVERSIONS; do
|
||||||
|
if ! pyenv local $version ; then
|
||||||
|
exit $?
|
||||||
|
fi
|
||||||
|
echo "====== Running test_pyenvlib.py on $version ====="
|
||||||
|
if ! python ./test_pyenvlib.py --weak-verify --max 800 --${version} ; then
|
||||||
|
exit $?
|
||||||
|
fi
|
||||||
|
echo "------ Done test_pyenvlib.py on $version -----"
|
||||||
|
done
|
@@ -1,5 +1,5 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
PYTHON_VERSION=3.6.3
|
PYTHON_VERSION=3.6.4
|
||||||
|
|
||||||
# FIXME put some of the below in a common routine
|
# FIXME put some of the below in a common routine
|
||||||
function finish {
|
function finish {
|
||||||
|
@@ -7,7 +7,8 @@ machine:
|
|||||||
dependencies:
|
dependencies:
|
||||||
override:
|
override:
|
||||||
- pip install -e .
|
- pip install -e .
|
||||||
- pip install -r requirements-dev.txt
|
- pip install pytest==3.2.5 hypothesis
|
||||||
test:
|
test:
|
||||||
override:
|
override:
|
||||||
- python ./setup.py develop && make check-2.6
|
- python ./setup.py develop && make check-2.7
|
||||||
|
- cd ./test/stdlib && pyenv local 2.7.10 && bash ./runtests.sh 'test_[f-i]*.py'
|
||||||
|
@@ -1,4 +1,5 @@
|
|||||||
from uncompyle6.semantics.fragments import deparse_code as deparse
|
import pytest
|
||||||
|
from uncompyle6.semantics.fragments import code_deparse as deparse, deparsed_find
|
||||||
from uncompyle6 import PYTHON_VERSION, PYTHON3
|
from uncompyle6 import PYTHON_VERSION, PYTHON3
|
||||||
|
|
||||||
def map_stmts(x, y):
|
def map_stmts(x, y):
|
||||||
@@ -30,21 +31,24 @@ def list_comp():
|
|||||||
|
|
||||||
def get_parsed_for_fn(fn):
|
def get_parsed_for_fn(fn):
|
||||||
code = fn.func_code
|
code = fn.func_code
|
||||||
return deparse(PYTHON_VERSION, code)
|
return deparse(code, version=PYTHON_VERSION)
|
||||||
|
|
||||||
def check_expect(expect, parsed):
|
def check_expect(expect, parsed, fn_name):
|
||||||
debug = False
|
debug = False
|
||||||
i = 2
|
i = 2
|
||||||
max_expect = len(expect)
|
max_expect = len(expect)
|
||||||
|
code = get_parsed_for_fn(fn_name)
|
||||||
for name, offset in sorted(parsed.offsets.keys()):
|
for name, offset in sorted(parsed.offsets.keys()):
|
||||||
assert i+1 <= max_expect, "ran out if items in testing node"
|
assert i+1 <= max_expect, (
|
||||||
|
"%s: ran out if items in testing node" % fn_name)
|
||||||
nodeInfo = parsed.offsets[name, offset]
|
nodeInfo = parsed.offsets[name, offset]
|
||||||
node = nodeInfo.node
|
node = nodeInfo.node
|
||||||
|
nodeInfo2 = deparsed_find((name, offset), parsed, code)
|
||||||
extractInfo = parsed.extract_node_info(node)
|
extractInfo = parsed.extract_node_info(node)
|
||||||
|
|
||||||
assert expect[i] == extractInfo.selectedLine, \
|
assert expect[i] == extractInfo.selectedLine, \
|
||||||
('line %s expect:\n%s\ngot:\n%s' %
|
('%s: line %s expect:\n%s\ngot:\n%s' %
|
||||||
(i, expect[i], extractInfo.selectedLine))
|
(fn_name, i, expect[i], extractInfo.selectedLine))
|
||||||
assert expect[i+1] == extractInfo.markerLine, \
|
assert expect[i+1] == extractInfo.markerLine, \
|
||||||
('line %s expect:\n%s\ngot:\n%s' %
|
('line %s expect:\n%s\ngot:\n%s' %
|
||||||
(i+1, expect[i+1], extractInfo.markerLine))
|
(i+1, expect[i+1], extractInfo.markerLine))
|
||||||
@@ -73,6 +77,7 @@ def check_expect(expect, parsed):
|
|||||||
|
|
||||||
|
|
||||||
def test_stuff():
|
def test_stuff():
|
||||||
|
return
|
||||||
parsed = get_parsed_for_fn(map_stmts)
|
parsed = get_parsed_for_fn(map_stmts)
|
||||||
expect = """
|
expect = """
|
||||||
-1
|
-1
|
||||||
@@ -83,10 +88,10 @@ return (x, y)
|
|||||||
-------------
|
-------------
|
||||||
0
|
0
|
||||||
x = []
|
x = []
|
||||||
--
|
-
|
||||||
Contained in...
|
Contained in...
|
||||||
x = []
|
x = []
|
||||||
------
|
--
|
||||||
3
|
3
|
||||||
x = []
|
x = []
|
||||||
-
|
-
|
||||||
@@ -95,10 +100,10 @@ x = []
|
|||||||
------
|
------
|
||||||
6
|
6
|
||||||
y = {}
|
y = {}
|
||||||
--
|
-
|
||||||
Contained in...
|
Contained in...
|
||||||
y = {}
|
y = {}
|
||||||
------
|
--
|
||||||
9
|
9
|
||||||
y = {}
|
y = {}
|
||||||
-
|
-
|
||||||
@@ -130,7 +135,7 @@ Contained in...
|
|||||||
x = [] ...
|
x = [] ...
|
||||||
------ ...
|
------ ...
|
||||||
""".split("\n")
|
""".split("\n")
|
||||||
check_expect(expect, parsed)
|
check_expect(expect, parsed, 'map_stmts')
|
||||||
########################################################
|
########################################################
|
||||||
# return
|
# return
|
||||||
|
|
||||||
@@ -167,7 +172,7 @@ Contained in...
|
|||||||
return (x, y)
|
return (x, y)
|
||||||
-------------
|
-------------
|
||||||
""".split("\n")
|
""".split("\n")
|
||||||
check_expect(expect, parsed)
|
check_expect(expect, parsed, 'return_stmt')
|
||||||
########################################################
|
########################################################
|
||||||
# # try
|
# # try
|
||||||
|
|
||||||
@@ -315,4 +320,4 @@ for i in range(2): ...
|
|||||||
""".split("\n")
|
""".split("\n")
|
||||||
parsed = get_parsed_for_fn(for_range_stmt)
|
parsed = get_parsed_for_fn(for_range_stmt)
|
||||||
if not PYTHON3:
|
if not PYTHON3:
|
||||||
check_expect(expect, parsed)
|
check_expect(expect, parsed, 'range_stmt')
|
||||||
|
@@ -11,20 +11,14 @@ src_dir = get_srcdir()
|
|||||||
os.chdir(src_dir)
|
os.chdir(src_dir)
|
||||||
|
|
||||||
|
|
||||||
@pytest.mark.parametrize(("test_tuple", "function_to_test"), [
|
@pytest.mark.parametrize(("test_tuple"), [
|
||||||
(
|
('../test/bytecode_2.7/05_if.pyc', 'testdata/if-2.7.right',),
|
||||||
('../test/bytecode_2.7/05_if.pyc', 'testdata/if-2.7.right',),
|
('../test/bytecode_2.7/05_ifelse.pyc', 'testdata/ifelse-2.7.right',),
|
||||||
disassemble_file
|
|
||||||
),
|
|
||||||
(
|
|
||||||
('../test/bytecode_2.7/05_ifelse.pyc', 'testdata/ifelse-2.7.right',),
|
|
||||||
disassemble_file
|
|
||||||
),
|
|
||||||
])
|
])
|
||||||
def test_funcoutput(capfd, test_tuple, function_to_test):
|
def test_funcoutput(capfd, test_tuple):
|
||||||
|
|
||||||
in_file , filename_expected = test_tuple
|
in_file, filename_expected = test_tuple
|
||||||
function_to_test(in_file, native=False)
|
disassemble_file(in_file)
|
||||||
resout, reserr = capfd.readouterr()
|
resout, reserr = capfd.readouterr()
|
||||||
expected = open(filename_expected, "r").read()
|
expected = open(filename_expected, "r").read()
|
||||||
if resout != expected:
|
if resout != expected:
|
||||||
|
@@ -26,7 +26,12 @@ def test_if_in_for():
|
|||||||
scan = get_scanner(PYTHON_VERSION)
|
scan = get_scanner(PYTHON_VERSION)
|
||||||
if 2.7 <= PYTHON_VERSION <= 3.0 and not IS_PYPY:
|
if 2.7 <= PYTHON_VERSION <= 3.0 and not IS_PYPY:
|
||||||
n = scan.setup_code(code)
|
n = scan.setup_code(code)
|
||||||
|
bytecode = Bytecode(code, scan.opc)
|
||||||
scan.build_lines_data(code, n)
|
scan.build_lines_data(code, n)
|
||||||
|
scan.insts = list(bytecode)
|
||||||
|
scan.offset2inst_index = {}
|
||||||
|
for i, inst in enumerate(scan.insts):
|
||||||
|
scan.offset2inst_index[inst.offset] = i
|
||||||
scan.build_prev_op(n)
|
scan.build_prev_op(n)
|
||||||
fjt = scan.find_jump_targets(False)
|
fjt = scan.find_jump_targets(False)
|
||||||
|
|
||||||
@@ -43,8 +48,13 @@ def test_if_in_for():
|
|||||||
|
|
||||||
code = bug_loop.__code__
|
code = bug_loop.__code__
|
||||||
n = scan.setup_code(code)
|
n = scan.setup_code(code)
|
||||||
|
bytecode = Bytecode(code, scan.opc)
|
||||||
scan.build_lines_data(code, n)
|
scan.build_lines_data(code, n)
|
||||||
|
scan.insts = list(bytecode)
|
||||||
scan.build_prev_op(n)
|
scan.build_prev_op(n)
|
||||||
|
scan.offset2inst_index = {}
|
||||||
|
for i, inst in enumerate(scan.insts):
|
||||||
|
scan.offset2inst_index[inst.offset] = i
|
||||||
fjt = scan.find_jump_targets(False)
|
fjt = scan.find_jump_targets(False)
|
||||||
assert{64: [42], 67: [42, 42], 42: [16, 41], 19: [6]} == fjt
|
assert{64: [42], 67: [42, 42], 42: [16, 41], 19: [6]} == fjt
|
||||||
assert scan.structs == [
|
assert scan.structs == [
|
||||||
@@ -60,9 +70,12 @@ def test_if_in_for():
|
|||||||
elif 3.2 < PYTHON_VERSION <= 3.4:
|
elif 3.2 < PYTHON_VERSION <= 3.4:
|
||||||
bytecode = Bytecode(code, scan.opc)
|
bytecode = Bytecode(code, scan.opc)
|
||||||
scan.code = array('B', code.co_code)
|
scan.code = array('B', code.co_code)
|
||||||
scan.build_lines_data(code)
|
scan.lines = scan.build_lines_data(code)
|
||||||
scan.build_prev_op()
|
scan.build_prev_op()
|
||||||
scan.insts = list(bytecode)
|
scan.insts = list(bytecode)
|
||||||
|
scan.offset2inst_index = {}
|
||||||
|
for i, inst in enumerate(scan.insts):
|
||||||
|
scan.offset2inst_index[inst.offset] = i
|
||||||
fjt = scan.find_jump_targets(False)
|
fjt = scan.find_jump_targets(False)
|
||||||
assert {69: [66], 63: [18]} == fjt
|
assert {69: [66], 63: [18]} == fjt
|
||||||
assert scan.structs == \
|
assert scan.structs == \
|
||||||
|
@@ -16,32 +16,48 @@ def test_grammar():
|
|||||||
p = get_python_parser(PYTHON_VERSION, is_pypy=IS_PYPY)
|
p = get_python_parser(PYTHON_VERSION, is_pypy=IS_PYPY)
|
||||||
(lhs, rhs, tokens,
|
(lhs, rhs, tokens,
|
||||||
right_recursive, dup_rhs) = p.check_sets()
|
right_recursive, dup_rhs) = p.check_sets()
|
||||||
expect_lhs = set(['expr1024', 'pos_arg'])
|
|
||||||
unused_rhs = set(['build_list', 'call_function', 'mkfunc',
|
# We have custom rules that create the below
|
||||||
|
expect_lhs = set(['expr1024', 'pos_arg', 'get_iter', 'attribute'])
|
||||||
|
|
||||||
|
unused_rhs = set(['list', 'mkfunc',
|
||||||
'mklambda',
|
'mklambda',
|
||||||
'unpack',])
|
'unpack',])
|
||||||
|
expect_right_recursive = set([('designList',
|
||||||
expect_right_recursive = frozenset([('designList',
|
('store', 'DUP_TOP', 'designList'))])
|
||||||
('designator', 'DUP_TOP', 'designList'))])
|
|
||||||
if PYTHON3:
|
if PYTHON3:
|
||||||
expect_lhs.add('load_genexpr')
|
expect_lhs.add('load_genexpr')
|
||||||
|
expect_lhs.add('kvlist')
|
||||||
|
expect_lhs.add('kv3')
|
||||||
|
|
||||||
unused_rhs = unused_rhs.union(set("""
|
unused_rhs = unused_rhs.union(set("""
|
||||||
except_pop_except genexpr classdefdeco2 listcomp
|
except_pop_except generator_exp classdefdeco2
|
||||||
|
dict
|
||||||
""".split()))
|
""".split()))
|
||||||
if 3.0 <= PYTHON_VERSION:
|
if PYTHON_VERSION >= 3.0:
|
||||||
expect_lhs.add("annotate_arg")
|
expect_lhs.add("annotate_arg")
|
||||||
expect_lhs.add("annotate_tuple")
|
expect_lhs.add("annotate_tuple")
|
||||||
unused_rhs.add("mkfunc_annotate")
|
unused_rhs.add("mkfunc_annotate")
|
||||||
|
unused_rhs.add('call')
|
||||||
|
if PYTHON_VERSION < 3.6:
|
||||||
|
# 3.6 has at least one non-custom call rule
|
||||||
|
# the others don't
|
||||||
|
unused_rhs.add('call')
|
||||||
|
if PYTHON_VERSION == 3.5:
|
||||||
|
expect_right_recursive.add((('l_stmts',
|
||||||
|
('lastl_stmt', 'COME_FROM', 'l_stmts'))))
|
||||||
|
pass
|
||||||
|
pass
|
||||||
|
else:
|
||||||
|
expect_right_recursive.add((('l_stmts',
|
||||||
|
('lastl_stmt', 'COME_FROM', 'l_stmts'))))
|
||||||
|
# expect_lhs.add('kwargs1')
|
||||||
|
pass
|
||||||
pass
|
pass
|
||||||
|
pass
|
||||||
else:
|
else:
|
||||||
expect_lhs.add('kwarg')
|
expect_lhs.add('kwarg')
|
||||||
|
unused_rhs.add('call')
|
||||||
# FIXME: grammar remove_rule on
|
|
||||||
# kv3 ::= expr expr STORE_MAP
|
|
||||||
# doesn't currently work in grammar, so we have this extraneous kv3 around.
|
|
||||||
if 3.3 <= PYTHON_VERSION <= 3.4:
|
|
||||||
expect_lhs.add('kv3')
|
|
||||||
|
|
||||||
assert expect_lhs == set(lhs)
|
assert expect_lhs == set(lhs)
|
||||||
assert unused_rhs == set(rhs)
|
assert unused_rhs == set(rhs)
|
||||||
@@ -50,7 +66,7 @@ def test_grammar():
|
|||||||
expect_dup_rhs = frozenset([('COME_FROM',), ('CONTINUE',), ('JUMP_ABSOLUTE',),
|
expect_dup_rhs = frozenset([('COME_FROM',), ('CONTINUE',), ('JUMP_ABSOLUTE',),
|
||||||
('LOAD_CONST',),
|
('LOAD_CONST',),
|
||||||
('JUMP_BACK',), ('JUMP_FORWARD',)])
|
('JUMP_BACK',), ('JUMP_FORWARD',)])
|
||||||
reduced_dup_rhs = {k: dup_rhs[k] for k in dup_rhs if k not in expect_dup_rhs}
|
reduced_dup_rhs = dict((k, dup_rhs[k]) for k in dup_rhs if k not in expect_dup_rhs)
|
||||||
for k in reduced_dup_rhs:
|
for k in reduced_dup_rhs:
|
||||||
print(k, reduced_dup_rhs[k])
|
print(k, reduced_dup_rhs[k])
|
||||||
# assert not reduced_dup_rhs, reduced_dup_rhs
|
# assert not reduced_dup_rhs, reduced_dup_rhs
|
||||||
|
@@ -1,4 +1,6 @@
|
|||||||
|
import sys
|
||||||
from uncompyle6 import PYTHON3
|
from uncompyle6 import PYTHON3
|
||||||
|
from uncompyle6.scanner import get_scanner
|
||||||
from uncompyle6.semantics.consts import (
|
from uncompyle6.semantics.consts import (
|
||||||
escape, NONE,
|
escape, NONE,
|
||||||
# RETURN_NONE, PASS, RETURN_LOCALS
|
# RETURN_NONE, PASS, RETURN_LOCALS
|
||||||
@@ -13,7 +15,10 @@ from uncompyle6.semantics.pysource import SourceWalker as SourceWalker
|
|||||||
|
|
||||||
def test_template_engine():
|
def test_template_engine():
|
||||||
s = StringIO()
|
s = StringIO()
|
||||||
sw = SourceWalker(2.7, s, None)
|
sys_version = float(sys.version[0:3])
|
||||||
|
scanner = get_scanner(sys_version, is_pypy=False)
|
||||||
|
scanner.insts = []
|
||||||
|
sw = SourceWalker(2.7, s, scanner)
|
||||||
sw.ast = NONE
|
sw.ast = NONE
|
||||||
sw.template_engine(('--%c--', 0), NONE)
|
sw.template_engine(('--%c--', 0), NONE)
|
||||||
print(sw.f.getvalue())
|
print(sw.f.getvalue())
|
||||||
|
23
pytest/test_token.py
Normal file
23
pytest/test_token.py
Normal file
@@ -0,0 +1,23 @@
|
|||||||
|
from uncompyle6.scanners.tok import Token
|
||||||
|
|
||||||
|
def test_token():
|
||||||
|
# Test token formatting of: LOAD_CONST None
|
||||||
|
t = Token('LOAD_CONST', offset=0, attr=None, pattr=None, has_arg=True)
|
||||||
|
expect = ' 0 LOAD_CONST None'
|
||||||
|
# print(t.format())
|
||||||
|
assert t
|
||||||
|
assert t.format() == expect
|
||||||
|
|
||||||
|
# Make sure equality testing of tokens ignores offset
|
||||||
|
t2 = Token('LOAD_CONST', offset=2, attr=None, pattr=None, has_arg=True)
|
||||||
|
assert t2 == t
|
||||||
|
|
||||||
|
|
||||||
|
# Make sure formatting of: LOAD_CONST False. We assume False is the 0th index
|
||||||
|
# of co_consts.
|
||||||
|
t = Token('LOAD_CONST', offset=1, attr=False, pattr=False, has_arg=True)
|
||||||
|
expect = ' 1 LOAD_CONST 0 False'
|
||||||
|
assert t.format() == expect
|
||||||
|
|
||||||
|
if __name__ == '__main__':
|
||||||
|
test_token()
|
6
pytest/testdata/if-2.7.right
vendored
6
pytest/testdata/if-2.7.right
vendored
@@ -7,6 +7,6 @@
|
|||||||
7 6 LOAD_NAME 1 'False'
|
7 6 LOAD_NAME 1 'False'
|
||||||
9 STORE_NAME 2 'b'
|
9 STORE_NAME 2 'b'
|
||||||
12 JUMP_FORWARD 0 'to 15'
|
12 JUMP_FORWARD 0 'to 15'
|
||||||
15_0 COME_FROM '12'
|
15_0 COME_FROM 12 '12'
|
||||||
15 LOAD_CONST 0 ''
|
15 LOAD_CONST 0 None
|
||||||
18 RETURN_VALUE
|
18 RETURN_VALUE
|
||||||
|
6
pytest/testdata/ifelse-2.7.right
vendored
6
pytest/testdata/ifelse-2.7.right
vendored
@@ -10,6 +10,6 @@
|
|||||||
|
|
||||||
6 15 LOAD_CONST 1 2
|
6 15 LOAD_CONST 1 2
|
||||||
18 STORE_NAME 2 'd'
|
18 STORE_NAME 2 'd'
|
||||||
21_0 COME_FROM '12'
|
21_0 COME_FROM 12 '12'
|
||||||
21 LOAD_CONST 2 ''
|
21 LOAD_CONST 2 None
|
||||||
24 RETURN_VALUE
|
24 RETURN_VALUE
|
||||||
|
@@ -1,3 +1,3 @@
|
|||||||
pytest>=3.0.0
|
pytest>=3.0.0
|
||||||
flake8
|
flake8
|
||||||
hypothesis
|
hypothesis<=3.8.3
|
||||||
|
15
setup.py
15
setup.py
@@ -1,7 +1,20 @@
|
|||||||
#!/usr/bin/env python
|
#!/usr/bin/env python
|
||||||
|
|
||||||
"""Setup script for the 'uncompyle6' distribution."""
|
"""Setup script for the 'uncompyle6' distribution."""
|
||||||
|
|
||||||
|
import sys
|
||||||
|
|
||||||
|
SYS_VERSION = sys.version_info[0:2]
|
||||||
|
if not ((2, 4) <= SYS_VERSION <= (2, 7)):
|
||||||
|
mess = "Python Release 2.4 .. 2.7 are supported in this code branch."
|
||||||
|
if ((3, 2) <= SYS_VERSION <= (3, 7)):
|
||||||
|
mess += ("\nFor your Python, version %s, use the master code/branch." %
|
||||||
|
sys.version[0:3])
|
||||||
|
else:
|
||||||
|
mess += ("\nThis package is not supported before Python 2.4. Your Python version is %s."
|
||||||
|
% sys.version[0:3])
|
||||||
|
print(mess)
|
||||||
|
raise Exception(mess)
|
||||||
|
|
||||||
from __pkginfo__ import \
|
from __pkginfo__ import \
|
||||||
author, author_email, install_requires, \
|
author, author_email, install_requires, \
|
||||||
license, long_description, classifiers, \
|
license, long_description, classifiers, \
|
||||||
|
55
test-unit/test_grammar.py
Normal file
55
test-unit/test_grammar.py
Normal file
@@ -0,0 +1,55 @@
|
|||||||
|
import re
|
||||||
|
import unittest
|
||||||
|
from uncompyle6 import PYTHON_VERSION, IS_PYPY # , PYTHON_VERSION
|
||||||
|
from uncompyle6.parser import get_python_parser, python_parser
|
||||||
|
|
||||||
|
class TestGrammar(unittest.TestCase):
|
||||||
|
def test_grammar(self):
|
||||||
|
|
||||||
|
def check_tokens(tokens, opcode_set):
|
||||||
|
remain_tokens = set(tokens) - opcode_set
|
||||||
|
remain_tokens = set([re.sub('_\d+$','', t) for t in remain_tokens])
|
||||||
|
remain_tokens = set([re.sub('_CONT$','', t) for t in remain_tokens])
|
||||||
|
remain_tokens = set(remain_tokens) - opcode_set
|
||||||
|
self.assertEqual(remain_tokens, set([]),
|
||||||
|
"Remaining tokens %s\n====\n%s" % (remain_tokens, p.dump_grammar()))
|
||||||
|
|
||||||
|
p = get_python_parser(PYTHON_VERSION, is_pypy=IS_PYPY)
|
||||||
|
(lhs, rhs, tokens,
|
||||||
|
right_recursive, dup_rhs) = p.check_sets()
|
||||||
|
expect_lhs = set(['expr1024', 'pos_arg'])
|
||||||
|
unused_rhs = set(['list', 'call', 'mkfunc',
|
||||||
|
'mklambda',
|
||||||
|
'unpack',])
|
||||||
|
|
||||||
|
expect_right_recursive = frozenset([('designList',
|
||||||
|
('store', 'DUP_TOP', 'designList'))])
|
||||||
|
expect_lhs.add('kwarg')
|
||||||
|
|
||||||
|
self.assertEqual(expect_lhs, set(lhs))
|
||||||
|
self.assertEqual(unused_rhs, set(rhs))
|
||||||
|
self.assertEqual(expect_right_recursive, right_recursive)
|
||||||
|
|
||||||
|
expect_dup_rhs = frozenset([('COME_FROM',), ('CONTINUE',), ('JUMP_ABSOLUTE',),
|
||||||
|
('LOAD_CONST',),
|
||||||
|
('JUMP_BACK',), ('JUMP_FORWARD',)])
|
||||||
|
|
||||||
|
reduced_dup_rhs = {}
|
||||||
|
for k in dup_rhs:
|
||||||
|
if k not in expect_dup_rhs:
|
||||||
|
reduced_dup_rhs[k] = dup_rhs[k]
|
||||||
|
pass
|
||||||
|
pass
|
||||||
|
for k in reduced_dup_rhs:
|
||||||
|
print(k, reduced_dup_rhs[k])
|
||||||
|
# assert not reduced_dup_rhs, reduced_dup_rhs
|
||||||
|
|
||||||
|
def test_dup_rule(self):
|
||||||
|
import inspect
|
||||||
|
python_parser(PYTHON_VERSION, inspect.currentframe().f_code,
|
||||||
|
is_pypy=IS_PYPY,
|
||||||
|
parser_debug={
|
||||||
|
'dups': True, 'transition': False, 'reduce': False,
|
||||||
|
'rules': False, 'errorstack': None, 'context': True})
|
||||||
|
if __name__ == '__main__':
|
||||||
|
unittest.main()
|
@@ -1,4 +1,12 @@
|
|||||||
PHONY=check clean dist distclean test test-unit test-functional rmChangeLog clean_pyc nosetests
|
PHONY=check clean dist distclean test test-unit test-functional rmChangeLog clean_pyc nosetests \
|
||||||
|
check-bytecode-1.5 check-bytecode-1 check-bytecode-2 check-bytecode-3 \
|
||||||
|
check-bytecode-2.2 check-byteocde-2.3 check-bytecode-2.4 \
|
||||||
|
check-short check-2.6 check-2.7 check-3.0 check-3.1 check-3.2 check-3.3 \
|
||||||
|
check-3.4 check-3.5 check-5.6 5.6 5.8 \
|
||||||
|
grammar-coverage-2.5 grammar-coverage-2.6 grammarcoverage-2.7 \
|
||||||
|
grammar-coverage-3.1 grammar-coverage-3.2 grammarcoverage-3.3 \
|
||||||
|
grammar-coverage-3.4 grammar-coverage-3.5 grammarcoverage-3.6
|
||||||
|
|
||||||
|
|
||||||
GIT2CL ?= git2cl
|
GIT2CL ?= git2cl
|
||||||
PYTHON ?= python
|
PYTHON ?= python
|
||||||
@@ -44,7 +52,8 @@ check-3.4: check-bytecode check-3.4-ok check-2.7-ok
|
|||||||
|
|
||||||
#: Run working tests from Python 3.5
|
#: Run working tests from Python 3.5
|
||||||
check-3.5: check-bytecode
|
check-3.5: check-bytecode
|
||||||
$(PYTHON) test_pythonlib.py --bytecode-3.5 --verify $(COMPILE)
|
$(PYTHON) test_pythonlib.py --bytecode-3.5 --weak-verify $(COMPILE)
|
||||||
|
$(PYTHON) test_pythonlib.py --bytecode-3.5-run --verify-run
|
||||||
|
|
||||||
#: Run working tests from Python 3.6
|
#: Run working tests from Python 3.6
|
||||||
check-3.6: check-bytecode
|
check-3.6: check-bytecode
|
||||||
@@ -59,8 +68,7 @@ check-disasm:
|
|||||||
$(PYTHON) dis-compare.py
|
$(PYTHON) dis-compare.py
|
||||||
|
|
||||||
#: Check deparsing bytecode 1.x only
|
#: Check deparsing bytecode 1.x only
|
||||||
check-bytecode-1:
|
check-bytecode-1: check-bytecode-1.5
|
||||||
$(PYTHON) test_pythonlib.py --bytecode-1.5
|
|
||||||
|
|
||||||
#: Check deparsing bytecode 2.x only
|
#: Check deparsing bytecode 2.x only
|
||||||
check-bytecode-2:
|
check-bytecode-2:
|
||||||
@@ -79,9 +87,13 @@ check-bytecode: check-bytecode-3
|
|||||||
$(PYTHON) test_pythonlib.py \
|
$(PYTHON) test_pythonlib.py \
|
||||||
--bytecode-2.1 --bytecode-2.2 --bytecode-2.3 --bytecode-2.4 \
|
--bytecode-2.1 --bytecode-2.2 --bytecode-2.3 --bytecode-2.4 \
|
||||||
--bytecode-2.5 --bytecode-2.6 --bytecode-2.7 \
|
--bytecode-2.5 --bytecode-2.6 --bytecode-2.7 \
|
||||||
--bytecode-pypy2.7 --bytecode-1
|
--bytecode-pypy2.7
|
||||||
|
|
||||||
|
|
||||||
|
#: Check deparsing bytecode 1.5 only
|
||||||
|
check-bytecode-1.5:
|
||||||
|
$(PYTHON) test_pythonlib.py --bytecode-1.5
|
||||||
|
|
||||||
#: Check deparsing Python 2.1
|
#: Check deparsing Python 2.1
|
||||||
check-bytecode-2.1:
|
check-bytecode-2.1:
|
||||||
$(PYTHON) test_pythonlib.py --bytecode-2.1
|
$(PYTHON) test_pythonlib.py --bytecode-2.1
|
||||||
@@ -126,6 +138,19 @@ grammar-coverage-2.7:
|
|||||||
SPARK_PARSER_COVERAGE=$(COVER_DIR)/spark-grammar-27.cover $(PYTHON) test_pythonlib.py --bytecode-2.7
|
SPARK_PARSER_COVERAGE=$(COVER_DIR)/spark-grammar-27.cover $(PYTHON) test_pythonlib.py --bytecode-2.7
|
||||||
SPARK_PARSER_COVERAGE=$(COVER_DIR)/spark-grammar-27.cover $(PYTHON) test_pyenvlib.py --2.7.13
|
SPARK_PARSER_COVERAGE=$(COVER_DIR)/spark-grammar-27.cover $(PYTHON) test_pyenvlib.py --2.7.13
|
||||||
|
|
||||||
|
#: Get grammar coverage for Python 3.0
|
||||||
|
grammar-coverage-3.0:
|
||||||
|
-rm $(COVER_DIR)/spark-grammar-30.cover
|
||||||
|
|
||||||
|
SPARK_PARSER_COVERAGE=$(COVER_DIR)/spark-grammar-30.cover $(PYTHON) test_pythonlib.py --bytecode-3.1
|
||||||
|
SPARK_PARSER_COVERAGE=$(COVER_DIR)/spark-grammar-30.cover $(PYTHON) test_pyenvlib.py --3.0.1
|
||||||
|
|
||||||
|
#: Get grammar coverage for Python 3.1
|
||||||
|
grammar-coverage-3.1:
|
||||||
|
-rm $(COVER_DIR)/spark-grammar-31.cover
|
||||||
|
SPARK_PARSER_COVERAGE=$(COVER_DIR)/spark-grammar-31.cover $(PYTHON) test_pythonlib.py --bytecode-3.1
|
||||||
|
SPARK_PARSER_COVERAGE=$(COVER_DIR)/spark-grammar-31.cover $(PYTHON) test_pyenvlib.py --3.1.5
|
||||||
|
|
||||||
#: Get grammar coverage for Python 3.2
|
#: Get grammar coverage for Python 3.2
|
||||||
grammar-coverage-3.2:
|
grammar-coverage-3.2:
|
||||||
-rm $(COVER_DIR)/spark-grammar-32.cover
|
-rm $(COVER_DIR)/spark-grammar-32.cover
|
||||||
@@ -138,53 +163,64 @@ grammar-coverage-3.3:
|
|||||||
SPARK_PARSER_COVERAGE=$(COVER_DIR)/spark-grammar-33.cover $(PYTHON) test_pythonlib.py --bytecode-3.3
|
SPARK_PARSER_COVERAGE=$(COVER_DIR)/spark-grammar-33.cover $(PYTHON) test_pythonlib.py --bytecode-3.3
|
||||||
SPARK_PARSER_COVERAGE=$(COVER_DIR)/spark-grammar-33.cover $(PYTHON) test_pyenvlib.py --3.3.6
|
SPARK_PARSER_COVERAGE=$(COVER_DIR)/spark-grammar-33.cover $(PYTHON) test_pyenvlib.py --3.3.6
|
||||||
|
|
||||||
##: Get grammar coverage for Python 3.4
|
#: Get grammar coverage for Python 3.4
|
||||||
grammar-coverage-3.4:
|
grammar-coverage-3.4:
|
||||||
-rm $(COVER_DIR)/spark-grammar-34.cover
|
-rm $(COVER_DIR)/spark-grammar-34.cover
|
||||||
SPARK_PARSER_COVERAGE=$(COVER_DIR)/spark-grammar-34.cover $(PYTHON) test_pythonlib.py --bytecode-3.4
|
SPARK_PARSER_COVERAGE=$(COVER_DIR)/spark-grammar-34.cover $(PYTHON) test_pythonlib.py --bytecode-3.4
|
||||||
SPARK_PARSER_COVERAGE=$(COVER_DIR)/spark-grammar-34.cover $(PYTHON) test_pyenvlib.py --3.4.2
|
SPARK_PARSER_COVERAGE=$(COVER_DIR)/spark-grammar-34.cover $(PYTHON) test_pyenvlib.py --3.4.2
|
||||||
|
|
||||||
##: Get grammar coverage for Python 3.5
|
#: Get grammar coverage for Python 3.5
|
||||||
grammar-coverage-3.5:
|
grammar-coverage-3.5:
|
||||||
rm $(COVER_DIR)/spark-grammar-35.cover || /bin/true
|
rm $(COVER_DIR)/spark-grammar-35.cover || /bin/true
|
||||||
SPARK_PARSER_COVERAGE=$(COVER_DIR)/spark-grammar-35.cover $(PYTHON) test_pythonlib.py --bytecode-3.5
|
SPARK_PARSER_COVERAGE=$(COVER_DIR)/spark-grammar-35.cover $(PYTHON) test_pythonlib.py --bytecode-3.5
|
||||||
SPARK_PARSER_COVERAGE=$(COVER_DIR)/spark-grammar-35.cover $(PYTHON) test_pyenvlib.py --3.5.2
|
SPARK_PARSER_COVERAGE=$(COVER_DIR)/spark-grammar-35.cover $(PYTHON) test_pyenvlib.py --3.5.3
|
||||||
|
|
||||||
#: Check deparsing Python 2.6
|
#: Check deparsing Python 2.6
|
||||||
pcheck-bytecode-2.6:
|
check-bytecode-2.6:
|
||||||
$(PYTHON) test_pythonlib.py --bytecode-2.6 --weak-verify
|
$(PYTHON) test_pythonlib.py --bytecode-2.6 --weak-verify
|
||||||
|
$(PYTHON) test_pythonlib.py --bytecode-2.6-run --verify-run
|
||||||
|
|
||||||
#: Check deparsing Python 2.7
|
#: Check deparsing Python 2.7
|
||||||
check-bytecode-2.7:
|
check-bytecode-2.7:
|
||||||
$(PYTHON) test_pythonlib.py --bytecode-2.7 --weak-verify
|
$(PYTHON) test_pythonlib.py --bytecode-2.7 --weak-verify
|
||||||
|
$(PYTHON) test_pythonlib.py --bytecode-2.7-run --verify-run
|
||||||
|
|
||||||
#: Check deparsing Python 3.0
|
#: Check deparsing Python 3.0
|
||||||
check-bytecode-3.0:
|
check-bytecode-3.0:
|
||||||
$(PYTHON) test_pythonlib.py --bytecode-3.0
|
$(PYTHON) test_pythonlib.py --bytecode-3.0 --weak-verify
|
||||||
|
|
||||||
#: Check deparsing Python 3.1
|
#: Check deparsing Python 3.1
|
||||||
check-bytecode-3.1:
|
check-bytecode-3.1:
|
||||||
$(PYTHON) test_pythonlib.py --bytecode-3.1
|
$(PYTHON) test_pythonlib.py --bytecode-3.1 --weak-verify
|
||||||
|
|
||||||
#: Check deparsing Python 3.2
|
#: Check deparsing Python 3.2
|
||||||
check-bytecode-3.2:
|
check-bytecode-3.2:
|
||||||
$(PYTHON) test_pythonlib.py --bytecode-3.2
|
$(PYTHON) test_pythonlib.py --bytecode-3.2 --weak-verify
|
||||||
|
|
||||||
#: Check deparsing Python 3.3
|
#: Check deparsing Python 3.3
|
||||||
check-bytecode-3.3:
|
check-bytecode-3.3:
|
||||||
$(PYTHON) test_pythonlib.py --bytecode-3.3
|
$(PYTHON) test_pythonlib.py --bytecode-3.3 --weak-verify
|
||||||
|
$(PYTHON) test_pythonlib.py --bytecode-3.3-run --verify-run
|
||||||
|
|
||||||
#: Check deparsing Python 3.4
|
#: Check deparsing Python 3.4
|
||||||
check-bytecode-3.4:
|
check-bytecode-3.4:
|
||||||
$(PYTHON) test_pythonlib.py --bytecode-3.4 --weak-verify
|
$(PYTHON) test_pythonlib.py --bytecode-3.4 --weak-verify
|
||||||
|
$(PYTHON) test_pythonlib.py --bytecode-3.4-run --verify-run
|
||||||
|
|
||||||
#: Check deparsing Python 3.5
|
#: Check deparsing Python 3.5
|
||||||
check-bytecode-3.5:
|
check-bytecode-3.5:
|
||||||
$(PYTHON) test_pythonlib.py --bytecode-3.5
|
$(PYTHON) test_pythonlib.py --bytecode-3.5 --weak-verify
|
||||||
|
$(PYTHON) test_pythonlib.py --bytecode-3.5-run --verify-run
|
||||||
|
|
||||||
|
#: Check deparsing Python 3.6
|
||||||
|
check-bytecode-3.6:
|
||||||
|
$(PYTHON) test_pythonlib.py --bytecode-3.6 --weak-verify
|
||||||
|
$(PYTHON) test_pythonlib.py --bytecode-3.6-run --verify-run
|
||||||
|
|
||||||
#: short tests for bytecodes only for this version of Python
|
#: short tests for bytecodes only for this version of Python
|
||||||
check-native-short:
|
check-native-short:
|
||||||
$(PYTHON) test_pythonlib.py --bytecode-$(PYTHON_VERSION) --weak-verify $(COMPILE)
|
$(PYTHON) test_pythonlib.py --bytecode-$(PYTHON_VERSION) --weak-verify $(COMPILE)
|
||||||
|
$(PYTHON) test_pythonlib.py --bytecode-$(PYTHON_VERSION)-run --verify-run $(COMPILE)
|
||||||
|
|
||||||
#: Run longer Python 2.6's lib files known to be okay
|
#: Run longer Python 2.6's lib files known to be okay
|
||||||
check-2.4-ok:
|
check-2.4-ok:
|
||||||
@@ -196,15 +232,15 @@ check-2.6-ok:
|
|||||||
|
|
||||||
#: Run longer Python 2.7's lib files known to be okay
|
#: Run longer Python 2.7's lib files known to be okay
|
||||||
check-2.7-ok:
|
check-2.7-ok:
|
||||||
$(PYTHON) test_pythonlib.py --ok-2.7 --verify $(COMPILE)
|
$(PYTHON) test_pythonlib.py --ok-2.7 --weak-verify $(COMPILE)
|
||||||
|
|
||||||
#: Run longer Python 3.2's lib files known to be okay
|
#: Run longer Python 3.2's lib files known to be okay
|
||||||
check-3.2-ok:
|
check-3.2-ok:
|
||||||
$(PYTHON) test_pythonlib.py --ok-3.2 --verify $(COMPILE)
|
$(PYTHON) test_pythonlib.py --ok-3.2 --weak-verify $(COMPILE)
|
||||||
|
|
||||||
#: Run longer Python 3.4's lib files known to be okay
|
#: Run longer Python 3.4's lib files known to be okay
|
||||||
check-3.4-ok:
|
check-3.4-ok:
|
||||||
$(PYTHON) test_pythonlib.py --ok-3.4 --verify $(COMPILE)
|
$(PYTHON) test_pythonlib.py --ok-3.4 --weak-verify $(COMPILE)
|
||||||
|
|
||||||
#: PyPy of some sort. E.g. [PyPy 5.0.1 with GCC 4.8.4]
|
#: PyPy of some sort. E.g. [PyPy 5.0.1 with GCC 4.8.4]
|
||||||
# Skip for now
|
# Skip for now
|
||||||
|
BIN
test/bytecode_2.1/00_import.pyc
Normal file
BIN
test/bytecode_2.1/00_import.pyc
Normal file
Binary file not shown.
BIN
test/bytecode_2.1/02_def.pyc
Normal file
BIN
test/bytecode_2.1/02_def.pyc
Normal file
Binary file not shown.
BIN
test/bytecode_2.1/10_del.pyc
Normal file
BIN
test/bytecode_2.1/10_del.pyc
Normal file
Binary file not shown.
Binary file not shown.
BIN
test/bytecode_2.2/02_def.pyc
Normal file
BIN
test/bytecode_2.2/02_def.pyc
Normal file
Binary file not shown.
BIN
test/bytecode_2.2/10_del.pyc
Normal file
BIN
test/bytecode_2.2/10_del.pyc
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
test/bytecode_2.4/01_augmented_assign.pyc
Normal file
BIN
test/bytecode_2.4/01_augmented_assign.pyc
Normal file
Binary file not shown.
BIN
test/bytecode_2.4/01_triple_compare.pyc
Normal file
BIN
test/bytecode_2.4/01_triple_compare.pyc
Normal file
Binary file not shown.
BIN
test/bytecode_2.4/02_decorator.pyc
Normal file
BIN
test/bytecode_2.4/02_decorator.pyc
Normal file
Binary file not shown.
Binary file not shown.
BIN
test/bytecode_2.4/02_except_as.pyc
Normal file
BIN
test/bytecode_2.4/02_except_as.pyc
Normal file
Binary file not shown.
BIN
test/bytecode_2.4/02_try_except_finally.pyc
Normal file
BIN
test/bytecode_2.4/02_try_except_finally.pyc
Normal file
Binary file not shown.
BIN
test/bytecode_2.4/02_unary_convert.pyc
Normal file
BIN
test/bytecode_2.4/02_unary_convert.pyc
Normal file
Binary file not shown.
BIN
test/bytecode_2.4/02_yield_bug.pyc
Normal file
BIN
test/bytecode_2.4/02_yield_bug.pyc
Normal file
Binary file not shown.
BIN
test/bytecode_2.4/03_if1.pyc
Normal file
BIN
test/bytecode_2.4/03_if1.pyc
Normal file
Binary file not shown.
BIN
test/bytecode_2.4/03_whileelse_bug.pyc
Normal file
BIN
test/bytecode_2.4/03_whileelse_bug.pyc
Normal file
Binary file not shown.
Binary file not shown.
BIN
test/bytecode_2.4_run/02_try_else_loop.pyc
Normal file
BIN
test/bytecode_2.4_run/02_try_else_loop.pyc
Normal file
Binary file not shown.
BIN
test/bytecode_2.4_run/03_try_else.pyc
Normal file
BIN
test/bytecode_2.4_run/03_try_else.pyc
Normal file
Binary file not shown.
BIN
test/bytecode_2.4_run/04_try_else_confuse.pyc
Normal file
BIN
test/bytecode_2.4_run/04_try_else_confuse.pyc
Normal file
Binary file not shown.
5
test/bytecode_2.4_run/README
Normal file
5
test/bytecode_2.4_run/README
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
These are byte-compiled programs compiled by Python 2.4
|
||||||
|
|
||||||
|
Furthrmore the programs here are self-checking: when decompiled and
|
||||||
|
then run again in a 2.4 interpreter, they will give an error if they
|
||||||
|
are miscompiled.
|
Binary file not shown.
BIN
test/bytecode_2.5/01_inplace_true_divide.pyc
Normal file
BIN
test/bytecode_2.5/01_inplace_true_divide.pyc
Normal file
Binary file not shown.
Binary file not shown.
BIN
test/bytecode_2.5/02_decorator.pyc
Normal file
BIN
test/bytecode_2.5/02_decorator.pyc
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
test/bytecode_2.5/02_unary_convert.pyc
Normal file
BIN
test/bytecode_2.5/02_unary_convert.pyc
Normal file
Binary file not shown.
BIN
test/bytecode_2.5/03_weird26.pyc
Normal file
BIN
test/bytecode_2.5/03_weird26.pyc
Normal file
Binary file not shown.
BIN
test/bytecode_2.5/05_dup_top_two.pyc
Normal file
BIN
test/bytecode_2.5/05_dup_top_two.pyc
Normal file
Binary file not shown.
BIN
test/bytecode_2.5/06_setif_comprehension.pyc
Normal file
BIN
test/bytecode_2.5/06_setif_comprehension.pyc
Normal file
Binary file not shown.
BIN
test/bytecode_2.5/08_if_while_else.pyc
Normal file
BIN
test/bytecode_2.5/08_if_while_else.pyc
Normal file
Binary file not shown.
Binary file not shown.
BIN
test/bytecode_2.5_run/02_try_else_loop.pyc
Normal file
BIN
test/bytecode_2.5_run/02_try_else_loop.pyc
Normal file
Binary file not shown.
BIN
test/bytecode_2.5_run/03_try_else.pyc
Normal file
BIN
test/bytecode_2.5_run/03_try_else.pyc
Normal file
Binary file not shown.
5
test/bytecode_2.5_run/README
Normal file
5
test/bytecode_2.5_run/README
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
These are byte-compiled programs compiled by Python 2.5.
|
||||||
|
|
||||||
|
Furthrmore the programs here are self-checking: when decompiled and
|
||||||
|
then run again in a 2.5 interpreter, they will give an error if they
|
||||||
|
are miscompiled.
|
Binary file not shown.
Binary file not shown.
BIN
test/bytecode_2.6/01_triple_compare.pyc
Normal file
BIN
test/bytecode_2.6/01_triple_compare.pyc
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
test/bytecode_2.6/02_ifelse_lambda.pyc
Normal file
BIN
test/bytecode_2.6/02_ifelse_lambda.pyc
Normal file
Binary file not shown.
BIN
test/bytecode_2.6/02_test_exec.pyc
Normal file
BIN
test/bytecode_2.6/02_test_exec.pyc
Normal file
Binary file not shown.
BIN
test/bytecode_2.6/02_while1_if_and.pyc
Normal file
BIN
test/bytecode_2.6/02_while1_if_and.pyc
Normal file
Binary file not shown.
BIN
test/bytecode_2.6/03_tryelse_continue.pyc
Normal file
BIN
test/bytecode_2.6/03_tryelse_continue.pyc
Normal file
Binary file not shown.
BIN
test/bytecode_2.6/03_weird26.pyc
Normal file
BIN
test/bytecode_2.6/03_weird26.pyc
Normal file
Binary file not shown.
BIN
test/bytecode_2.6/03_whileelse_bug.pyc
Normal file
BIN
test/bytecode_2.6/03_whileelse_bug.pyc
Normal file
Binary file not shown.
BIN
test/bytecode_2.6/05_unicode_literals.pyc
Normal file
BIN
test/bytecode_2.6/05_unicode_literals.pyc
Normal file
Binary file not shown.
BIN
test/bytecode_2.6/08_distbug.pyc
Normal file
BIN
test/bytecode_2.6/08_distbug.pyc
Normal file
Binary file not shown.
Binary file not shown.
BIN
test/bytecode_2.6_run/02_try_else_loop.pyc
Normal file
BIN
test/bytecode_2.6_run/02_try_else_loop.pyc
Normal file
Binary file not shown.
BIN
test/bytecode_2.6_run/03_try_else.pyc
Normal file
BIN
test/bytecode_2.6_run/03_try_else.pyc
Normal file
Binary file not shown.
5
test/bytecode_2.6_run/README
Normal file
5
test/bytecode_2.6_run/README
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
These are byte-compiled programs compiled by Python 2.6.
|
||||||
|
|
||||||
|
Furthrmore the programs here are self-checking: when decompiled and
|
||||||
|
then run again in a 2.6 interpreter, they will give an error if they
|
||||||
|
are miscompiled.
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
test/bytecode_2.7/01_rel_import.pyc
Normal file
BIN
test/bytecode_2.7/01_rel_import.pyc
Normal file
Binary file not shown.
Binary file not shown.
BIN
test/bytecode_2.7/02_def.pyc
Normal file
BIN
test/bytecode_2.7/02_def.pyc
Normal file
Binary file not shown.
BIN
test/bytecode_2.7/02_except_as.pyc
Normal file
BIN
test/bytecode_2.7/02_except_as.pyc
Normal file
Binary file not shown.
Binary file not shown.
BIN
test/bytecode_2.7/02_ifelsetmtl.pyc
Normal file
BIN
test/bytecode_2.7/02_ifelsetmtl.pyc
Normal file
Binary file not shown.
BIN
test/bytecode_2.7/02_unary_convert.pyc
Normal file
BIN
test/bytecode_2.7/02_unary_convert.pyc
Normal file
Binary file not shown.
Binary file not shown.
BIN
test/bytecode_2.7/03_if_vs_and.pyc
Normal file
BIN
test/bytecode_2.7/03_if_vs_and.pyc
Normal file
Binary file not shown.
BIN
test/bytecode_2.7/03_weird26.pyc
Normal file
BIN
test/bytecode_2.7/03_weird26.pyc
Normal file
Binary file not shown.
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user