You've already forked python-uncompyle6
mirror of
https://github.com/rocky/python-uncompyle6.git
synced 2025-08-03 00:45:53 +08:00
Compare commits
1028 Commits
release-py
...
release-py
Author | SHA1 | Date | |
---|---|---|---|
|
f443bdbc89 | ||
|
31160c915f | ||
|
a35a19d230 | ||
|
85c224e7ab | ||
|
7f8f082641 | ||
|
829078c622 | ||
|
78e759fe8d | ||
|
1d705b0451 | ||
|
1189deced5 | ||
|
4f59d432bf | ||
|
d758029cb9 | ||
|
0dcef6ea69 | ||
|
836f3b5b78 | ||
|
e07597ea44 | ||
|
9e69f27062 | ||
|
c0a0230928 | ||
|
f45f8788ef | ||
|
bdc026d3c1 | ||
|
ea15d26ce0 | ||
|
dc765d7bbb | ||
|
5cf1315805 | ||
|
5901e78770 | ||
|
d26a8163c0 | ||
|
1df2ebfbdf | ||
|
54aad6e4d6 | ||
|
90d99b202a | ||
|
b7e1c51243 | ||
|
12c5548a5c | ||
|
1644370165 | ||
|
58c1512dc5 | ||
|
e64859639f | ||
|
9c6f2ee838 | ||
|
7a17c8c441 | ||
|
ea36ff9bb1 | ||
|
8f3adcb1f8 | ||
|
8ebe4bfeb2 | ||
|
4a3e113b35 | ||
|
049d7c21bb | ||
|
c12ba1b493 | ||
|
9b93455c88 | ||
|
953fab5274 | ||
|
fa00af4b98 | ||
|
2ce546784c | ||
|
d4bd8bae71 | ||
|
ef6565b078 | ||
|
30f6bb7987 | ||
|
6b139af560 | ||
|
7b7c662a20 | ||
|
ae7fdccc7c | ||
|
f74a3d6deb | ||
|
e909585ebf | ||
|
cf30bfcd49 | ||
|
9e54a0dad3 | ||
|
00c9988c3a | ||
|
c8241938ba | ||
|
3d44adde41 | ||
|
6b9cfb3bd7 | ||
|
ee15035b68 | ||
|
b53b286666 | ||
|
1e993b9e59 | ||
|
c5ead0fdfc | ||
|
499f77e48b | ||
|
f4ff4e863d | ||
|
e491d79c81 | ||
|
35e64f51ee | ||
|
12fb4c6d04 | ||
|
68dc23784e | ||
|
b4c41bd690 | ||
|
550da8c134 | ||
|
21f785c4f4 | ||
|
01f306bd2c | ||
|
954195fd48 | ||
|
adcd72f6ed | ||
|
22a8def503 | ||
|
cca81f87ae | ||
|
771e8c9b99 | ||
|
967a44c587 | ||
|
d3280ecf76 | ||
|
c5e1368de7 | ||
|
dfa3a41dc9 | ||
|
2dfcc1206d | ||
|
4482730a23 | ||
|
4c95f8c3b0 | ||
|
3939466281 | ||
|
6b0c909460 | ||
|
0f34fb6726 | ||
|
30d7efb24c | ||
|
e12d840447 | ||
|
83f3424d26 | ||
|
db53037b56 | ||
|
9128813798 | ||
|
b7eae4f360 | ||
|
4ddb1565aa | ||
|
aeb9b2e665 | ||
|
75d90b933c | ||
|
3aed87ac5e | ||
|
af873f1e88 | ||
|
ee72f6d685 | ||
|
8d6d8b31e0 | ||
|
85e5d72529 | ||
|
274d5e9405 | ||
|
88ea782ced | ||
|
7209405b2c | ||
|
c151085387 | ||
|
493694024d | ||
|
2e7029ce07 | ||
|
a8f89fa006 | ||
|
5dd265021f | ||
|
ed205650e0 | ||
|
fcccf5bb97 | ||
|
dc79ec3a25 | ||
|
252f18400c | ||
|
bb5bec29f7 | ||
|
ebe0137b2d | ||
|
3b1742e779 | ||
|
f671aeee5d | ||
|
ad92f53e39 | ||
|
40f9b523b0 | ||
|
5681100764 | ||
|
fb9260c6ec | ||
|
5c0fd39e0b | ||
|
7a05a36f63 | ||
|
dfe9d3c34c | ||
|
d9907350b7 | ||
|
28e33f4b92 | ||
|
30463f75d6 | ||
|
40e64ba3e0 | ||
|
0993bb026b | ||
|
371b5c7600 | ||
|
29e413c13c | ||
|
0645cdfcb6 | ||
|
7c91694cf9 | ||
|
ac9c7d1047 | ||
|
3721722764 | ||
|
a5f28e94bf | ||
|
2db15210c9 | ||
|
58f9935bd6 | ||
|
404517e426 | ||
|
6c26f3fb8d | ||
|
f9eb15582a | ||
|
518bedb1d9 | ||
|
c4791885ff | ||
|
e4127b34a5 | ||
|
f3b3733f15 | ||
|
136eb6b104 | ||
|
f540f681c1 | ||
|
df6f39cb26 | ||
|
9ceb9eb9ac | ||
|
f7b0e895ed | ||
|
50f3c64277 | ||
|
76bca014dc | ||
|
aa5911c574 | ||
|
6cf305f7ef | ||
|
e77ccba40e | ||
|
2fcb7a62e1 | ||
|
028d87ddde | ||
|
b538da1e5f | ||
|
40ab77c7ba | ||
|
afb79f84e2 | ||
|
1f462cf503 | ||
|
7f30699f95 | ||
|
288b9b5c60 | ||
|
c0a86e6b9f | ||
|
909ec81b55 | ||
|
aa8bcb6621 | ||
|
94e57f3ccf | ||
|
1ed2b92988 | ||
|
a1ffe3e106 | ||
|
fe5f99ca98 | ||
|
a6eda99713 | ||
|
4cf0f83257 | ||
|
35f9020871 | ||
|
497e2df88a | ||
|
a51cd0df5d | ||
|
297c65d485 | ||
|
950dd05791 | ||
|
e9ff6136b5 | ||
|
f9f5a64c87 | ||
|
c7b71b4e34 | ||
|
4372ab86d3 | ||
|
a4971ee27d | ||
|
70690f2ede | ||
|
ab1b81a8da | ||
|
53bb14426b | ||
|
82a64b421d | ||
|
c048b26d4e | ||
|
ece788e09e | ||
|
d8e212c9ea | ||
|
d01a047dfd | ||
|
ad16ed69eb | ||
|
9c5addc0f0 | ||
|
aadc66fe4a | ||
|
a1f463982f | ||
|
ec4f98af63 | ||
|
1e72250f79 | ||
|
ef92f08f56 | ||
|
bdc751f444 | ||
|
b0e139e6cc | ||
|
c25962b998 | ||
|
956829d974 | ||
|
1e95ebd5f6 | ||
|
d1dc5a404c | ||
|
f50086f1da | ||
|
6dcb20341b | ||
|
ae75b4f677 | ||
|
4aa7f1ce67 | ||
|
18f253ffbe | ||
|
6b01da76ea | ||
|
96fd3312a6 | ||
|
489d479bd0 | ||
|
f55febfbf0 | ||
|
df1772164c | ||
|
a57ff9227d | ||
|
69823fbff4 | ||
|
47f0d5cd69 | ||
|
aae7777d92 | ||
|
2bfd0434a7 | ||
|
4bd6e609dd | ||
|
0897d47afa | ||
|
d0714edfe6 | ||
|
d2fc7d2dd3 | ||
|
b7ad271aa2 | ||
|
060c8df174 | ||
|
0b06b6943a | ||
|
82afbb5e98 | ||
|
dba73d6f02 | ||
|
078c1ffd16 | ||
|
70073e89bf | ||
|
be855a3001 | ||
|
0b8edba0dd | ||
|
5a2e5cf6bb | ||
|
655ab203ea | ||
|
793e9ced6a | ||
|
c4e7e99185 | ||
|
b50ca11709 | ||
|
078d306aca | ||
|
1345e6fc24 | ||
|
2580e20469 | ||
|
ee7fda2869 | ||
|
f2d141c466 | ||
|
cb7bbbb2e1 | ||
|
d7fdafc1f7 | ||
|
1cac7d50c1 | ||
|
4171dfc7e9 | ||
|
df7310e8ca | ||
|
8479e66add | ||
|
4281083641 | ||
|
5102e5f6e0 | ||
|
bee35aa05d | ||
|
4828ae99a3 | ||
|
26b60f6fb8 | ||
|
18133794e6 | ||
|
499acce8e6 | ||
|
aa1e6a7567 | ||
|
9e2ba8f01d | ||
|
3ea0d67be9 | ||
|
f41a16b7e9 | ||
|
6ba779b915 | ||
|
c07814538c | ||
|
2b9887ce9b | ||
|
86ba02d5f2 | ||
|
7e362a8635 | ||
|
d42fee1b50 | ||
|
54e9de4a7d | ||
|
e0aa4e9fad | ||
|
f8798945ab | ||
|
c1a5d3ce8d | ||
|
a941326a30 | ||
|
555fbe81da | ||
|
bef6ba7445 | ||
|
5b36e45805 | ||
|
a774cc1892 | ||
|
e03274c78c | ||
|
c2ed6776e6 | ||
|
5ff3a54ed7 | ||
|
1323500a76 | ||
|
9923a4c775 | ||
|
69c5954815 | ||
|
d14365766f | ||
|
dd20a38412 | ||
|
b83bcb871a | ||
|
076a40c06d | ||
|
504845668c | ||
|
375101d960 | ||
|
2a393a408b | ||
|
e596fb0917 | ||
|
2f3ffd5044 | ||
|
0ce23288cb | ||
|
8776657302 | ||
|
1ecceb6471 | ||
|
8c60166cf6 | ||
|
7d1b306b10 | ||
|
7cf4e31101 | ||
|
7ce05a1934 | ||
|
b89409a6d0 | ||
|
61784c4f43 | ||
|
f926acf7f1 | ||
|
291b8e0f90 | ||
|
a49f21bb1c | ||
|
68c646f1bb | ||
|
28bd433c9a | ||
|
3fcdc323f5 | ||
|
e1f41b724e | ||
|
6aa0725bae | ||
|
c37301b02b | ||
|
2fc80fc747 | ||
|
eaa063a15f | ||
|
83bf645535 | ||
|
43ed4f249e | ||
|
a173f27e7c | ||
|
e4e9cb2758 | ||
|
55368c8b29 | ||
|
17300f631f | ||
|
3b3ff705f9 | ||
|
dabc57a1fd | ||
|
a59e9c1aa8 | ||
|
4789ae0d94 | ||
|
66fe00ffb6 | ||
|
8483a5102b | ||
|
507a754616 | ||
|
6daca33443 | ||
|
930d03ab07 | ||
|
0ca5866ec7 | ||
|
d03a4235df | ||
|
7a4df3226e | ||
|
32114b5550 | ||
|
697d765a43 | ||
|
b512b20b56 | ||
|
175821f9d5 | ||
|
a99f0e51ab | ||
|
50f6625cd1 | ||
|
14fe8c5356 | ||
|
0ca2eca32f | ||
|
4096d310e4 | ||
|
5c6c6c663d | ||
|
8f09437537 | ||
|
d89153f910 | ||
|
c504bb2491 | ||
|
540f619745 | ||
|
4b9b3f27f9 | ||
|
550273d117 | ||
|
b8cc1be32b | ||
|
a040439f48 | ||
|
5f48a8bf2f | ||
|
0170e39f5d | ||
|
b8856993d2 | ||
|
4f6d3a3d7e | ||
|
fa62724f14 | ||
|
5220aa3b65 | ||
|
c8b94cf48f | ||
|
5268796134 | ||
|
e930c9c6ef | ||
|
a2780bc1c2 | ||
|
9fe3f94240 | ||
|
3471d11dd5 | ||
|
2a0a6c904c | ||
|
2d6f31df97 | ||
|
e5d82f7613 | ||
|
d8d8ed60d7 | ||
|
0f525c142d | ||
|
ee4d166e71 | ||
|
4be5c89efb | ||
|
7720c8aa10 | ||
|
003ad0ceef | ||
|
484ded7635 | ||
|
cdacc9770e | ||
|
aff0cd4baa | ||
|
a3c1943806 | ||
|
dd98eb8764 | ||
|
7ef3284f17 | ||
|
ee439540da | ||
|
5b2db856ec | ||
|
ae68f1823d | ||
|
9539a5c95c | ||
|
6899f2bd96 | ||
|
81e4169dea | ||
|
3c2ed93b34 | ||
|
97f8d91e35 | ||
|
48fc42d182 | ||
|
6e00a3bdbb | ||
|
b0250f4f9a | ||
|
27583856cb | ||
|
c5bc21bf6a | ||
|
f89a3e8fa1 | ||
|
2efe2b5b47 | ||
|
209f19c1da | ||
|
76f7bae0a6 | ||
|
05f743ed14 | ||
|
a93bec73cf | ||
|
997942e235 | ||
|
3ab9272eb0 | ||
|
7c4b82243b | ||
|
b5203a077d | ||
|
92c0534cd4 | ||
|
54299bb3e6 | ||
|
256d19d9b4 | ||
|
3a80c765ac | ||
|
56f10a8cfa | ||
|
62bff2f78d | ||
|
82d10e025c | ||
|
08f79e67fb | ||
|
2ac85acca5 | ||
|
b3163d09e8 | ||
|
b96e1df14b | ||
|
90930b66ce | ||
|
89829fbe4f | ||
|
290f70f202 | ||
|
164168e7f4 | ||
|
5d0dc5fffd | ||
|
040ed20b59 | ||
|
f06bd69858 | ||
|
819524fbd0 | ||
|
ef03e7151d | ||
|
fbd5cf5994 | ||
|
5a7755e047 | ||
|
ae81a830a8 | ||
|
98d7e42886 | ||
|
3aadd0574e | ||
|
eff663cc4e | ||
|
9caceed001 | ||
|
a11b290a81 | ||
|
bba9c577d1 | ||
|
0a781164c3 | ||
|
7a98ac990d | ||
|
8bae4e8d9c | ||
|
c4baec28de | ||
|
62da9f4583 | ||
|
65cf9ac48f | ||
|
890230b791 | ||
|
f72070e6d0 | ||
|
94832d654f | ||
|
6bb2605bed | ||
|
47e615bbfc | ||
|
77742532aa | ||
|
948ecf3123 | ||
|
e233b2f63a | ||
|
343f0f781a | ||
|
e87b2d6718 | ||
|
0742f0b83f | ||
|
2fbe61aa11 | ||
|
f36acf6faa | ||
|
96617c0895 | ||
|
e50cd1e07d | ||
|
1358d40aef | ||
|
c8c6f1a63d | ||
|
850500c7ad | ||
|
9ec8918c1f | ||
|
08ed185608 | ||
|
25cd759dbe | ||
|
000c060093 | ||
|
39d79217ca | ||
|
5390e3b838 | ||
|
8aeb0aad8c | ||
|
a2e34ab75c | ||
|
5c2af69925 | ||
|
8076c60eee | ||
|
1b4b6b334e | ||
|
482dbb5c82 | ||
|
08e27a8b0f | ||
|
55ffaa1aff | ||
|
91fa73bf01 | ||
|
9a1b77aff4 | ||
|
79d5790e3f | ||
|
381a470d90 | ||
|
64b75625a9 | ||
|
536d45deb1 | ||
|
dce7e809e2 | ||
|
5ddbea73f4 | ||
|
8a9a4ca6cc | ||
|
b8e9ce8a7a | ||
|
d75bf1c32a | ||
|
cef3203601 | ||
|
5b657ac7d8 | ||
|
1509bc4828 | ||
|
fad5089175 | ||
|
52262dc38a | ||
|
b61255535e | ||
|
ce58ed7434 | ||
|
01859ce820 | ||
|
ada786e08c | ||
|
cfb5c442e2 | ||
|
37f953c353 | ||
|
4d84a723f4 | ||
|
ddbfc168c5 | ||
|
a463220df2 | ||
|
3684b38310 | ||
|
f472275196 | ||
|
2bca6753d3 | ||
|
a0cb9c5d6a | ||
|
3ca66d0184 | ||
|
316adff2d4 | ||
|
1a3bd3cabe | ||
|
9bc9532c24 | ||
|
732e3331b8 | ||
|
fae5525514 | ||
|
730b739907 | ||
|
844144f90a | ||
|
c105edff47 | ||
|
f65aac7b97 | ||
|
68a145d050 | ||
|
c2e3ff0f43 | ||
|
b49033d584 | ||
|
d822017520 | ||
|
3dc6c31ae5 | ||
|
8de663ff52 | ||
|
6e0b010cd3 | ||
|
4b2f26ca70 | ||
|
e91fe14612 | ||
|
8ce921c5b7 | ||
|
5d609ae1aa | ||
|
7042d00203 | ||
|
6c8b3bfbe9 | ||
|
38cd854b81 | ||
|
33be603e3d | ||
|
5753f8114c | ||
|
1bfa4228d6 | ||
|
6116eb64d1 | ||
|
cb411bcd04 | ||
|
527d1b4163 | ||
|
f82b862c25 | ||
|
cafe96a44a | ||
|
fe5cea7042 | ||
|
6981743788 | ||
|
0e0c5b91fc | ||
|
b29a008cb3 | ||
|
3bfc51e34b | ||
|
486f10be6c | ||
|
f5bcdeec95 | ||
|
880a60c3e4 | ||
|
0cb0de53ae | ||
|
f57a238e47 | ||
|
57109ed066 | ||
|
c52af6cee9 | ||
|
bd9a8261fa | ||
|
0e4e45518d | ||
|
bb5bbc9645 | ||
|
283db0faea | ||
|
049a3415a7 | ||
|
3d2fc7a5e6 | ||
|
2a040bee5f | ||
|
3bd29b9c9a | ||
|
d4381ef73f | ||
|
3918bf248d | ||
|
a37ae1be0d | ||
|
108c6ecfe3 | ||
|
9f4458db9a | ||
|
ac7bec5ad8 | ||
|
74848140c5 | ||
|
9db3f1cf1d | ||
|
799570d068 | ||
|
3db66fad1d | ||
|
4e6c449250 | ||
|
da119a31f7 | ||
|
ae9f83c191 | ||
|
846020bf5a | ||
|
cf5c81ab21 | ||
|
244ab4e3b3 | ||
|
07290bd443 | ||
|
ef9c34098a | ||
|
57bca5102d | ||
|
a29d1e1531 | ||
|
3d649e049b | ||
|
26a7b984aa | ||
|
9b41dfd951 | ||
|
1091d32882 | ||
|
432859d677 | ||
|
25b7752915 | ||
|
bac3fea8cd | ||
|
9cc9bceadf | ||
|
36e09738c3 | ||
|
90439c562f | ||
|
d9975defe9 | ||
|
425b50cf1c | ||
|
2216eb7b01 | ||
|
31468a2328 | ||
|
d39191477b | ||
|
5489ee9857 | ||
|
f8c437230d | ||
|
e30051b460 | ||
|
b12893f343 | ||
|
80b0d4284b | ||
|
afedf43ee1 | ||
|
8684137f80 | ||
|
dc16f03f50 | ||
|
2c608c7909 | ||
|
3540c951dc | ||
|
4b46a8ffdf | ||
|
74961caed1 | ||
|
359672415b | ||
|
5b889bf4f3 | ||
|
7adfc9c2dc | ||
|
773bbdab0a | ||
|
9df8dd7384 | ||
|
ae148d57e5 | ||
|
78c4db722a | ||
|
eefe7bdb6b | ||
|
e07e2a498e | ||
|
4bf7e60bad | ||
|
37b7a4b0b6 | ||
|
b842189d8a | ||
|
2f9284c3a0 | ||
|
49a65f9454 | ||
|
72526dc806 | ||
|
747ec0d0bc | ||
|
a3932c7aec | ||
|
c683f3a88d | ||
|
a1d0ee9694 | ||
|
bee7bea330 | ||
|
e82a37528d | ||
|
93b31a2fa4 | ||
|
59124c913f | ||
|
de4a15a5b3 | ||
|
1f1a734598 | ||
|
96270b34d0 | ||
|
bc21e3163f | ||
|
ab4a998867 | ||
|
efac5268a4 | ||
|
ddaa7ef337 | ||
|
120bdaedb9 | ||
|
a73ca4bf18 | ||
|
1c8f885629 | ||
|
dfac71e092 | ||
|
827bd32a67 | ||
|
34957487f0 | ||
|
1c943a465a | ||
|
c77d9233f0 | ||
|
8cbdaecfc9 | ||
|
9bde5c6cac | ||
|
ecf6de26a0 | ||
|
495a969ccf | ||
|
1dafe0bd6a | ||
|
2c33a06535 | ||
|
efd8fe54b2 | ||
|
d3acbe2641 | ||
|
5b0f772dc7 | ||
|
93e26c7326 | ||
|
914369bd36 | ||
|
fcc4aff62c | ||
|
a6e2074606 | ||
|
44382ec78e | ||
|
592aba9dd8 | ||
|
2fb9b8f64d | ||
|
d8d52d5181 | ||
|
94c01d395a | ||
|
9bced5d2c9 | ||
|
fd7caf7f3f | ||
|
e2d7fd5f09 | ||
|
e29e979fbf | ||
|
729fdc9c8d | ||
|
0574f5302c | ||
|
595ac95f32 | ||
|
ed92f03bed | ||
|
43b1981244 | ||
|
cb5d4f4989 | ||
|
0639fdbbb7 | ||
|
e56088b566 | ||
|
40d2ef3071 | ||
|
5afa14a945 | ||
|
4f5ad533c3 | ||
|
7f7487206a | ||
|
82d8e0cd47 | ||
|
1c21e1c9d2 | ||
|
cd2072b8e3 | ||
|
145c18fbeb | ||
|
18bb1bc9e3 | ||
|
c0e8ce22af | ||
|
72a95e7cce | ||
|
3983aa1b92 | ||
|
8d85e78960 | ||
|
d3eca29934 | ||
|
f3b72884c6 | ||
|
504164fcea | ||
|
aa21fe0b31 | ||
|
2995acb8d9 | ||
|
3436a3a256 | ||
|
d634c5c17a | ||
|
f9fd63d5f5 | ||
|
123be56e5d | ||
|
7f46d8bb2a | ||
|
60d96b6a5a | ||
|
f9bb0b0a46 | ||
|
325bba5be5 | ||
|
715bf9cbab | ||
|
8187fdf4a6 | ||
|
900a0980c1 | ||
|
da44660a72 | ||
|
76c2883f62 | ||
|
d2fccfe357 | ||
|
23b7e6db18 | ||
|
1727977828 | ||
|
7fed369e88 | ||
|
81bbb81a42 | ||
|
3fa444a98d | ||
|
5475934c0d | ||
|
636257f879 | ||
|
c6bdfdd592 | ||
|
5a089c311a | ||
|
6c3639aef2 | ||
|
37ac0a3665 | ||
|
40b910e4e2 | ||
|
e058377214 | ||
|
57185d17fd | ||
|
f2e2bc7fa1 | ||
|
950035db9c | ||
|
f36c11d9d7 | ||
|
64a4b75ed9 | ||
|
adc7e5242c | ||
|
612a813c7c | ||
|
199ba86984 | ||
|
a4ae9a39af | ||
|
ddf73b653c | ||
|
83773846d6 | ||
|
8246f54831 | ||
|
92d6b62d56 | ||
|
bff171897a | ||
|
189d7c6562 | ||
|
a54a558a44 | ||
|
6443257e60 | ||
|
343f01cb8f | ||
|
87d0b6e3fb | ||
|
eb317480d8 | ||
|
663b6ca50f | ||
|
908dea4a23 | ||
|
309ccb8734 | ||
|
d687b44f70 | ||
|
b94d67e99a | ||
|
1f8a5dfa06 | ||
|
d420b2864e | ||
|
12e46504f3 | ||
|
d3bd73c281 | ||
|
86e29eaac8 | ||
|
e934d79170 | ||
|
398981e887 | ||
|
96c9a67554 | ||
|
44ffb04ee1 | ||
|
c78f9a3b7d | ||
|
f088ded236 | ||
|
beaedc7ca1 | ||
|
f9392ed908 | ||
|
eb30181e51 | ||
|
9edeb84adc | ||
|
f7a8aabdee | ||
|
214f5f32a3 | ||
|
53b471a3df | ||
|
2b730628d5 | ||
|
48006ab350 | ||
|
b3642094b2 | ||
|
a574168ca8 | ||
|
263b4b5653 | ||
|
19818ae632 | ||
|
477d73c71d | ||
|
7272ac4a60 | ||
|
7659277c5c | ||
|
761eee7ae7 | ||
|
600cee26d9 | ||
|
61466808f5 | ||
|
de25c5f003 | ||
|
8880568045 | ||
|
3c7d460036 | ||
|
ee3f2446f9 | ||
|
0b24eca8d7 | ||
|
3116ac8323 | ||
|
19bb16270d | ||
|
35c41f8065 | ||
|
9d36e7742e | ||
|
75f3624f31 | ||
|
2e78c007ee | ||
|
f5a10ed5d0 | ||
|
de75849ae3 | ||
|
30d6dcdd69 | ||
|
c48345a5c0 | ||
|
a1cdc5e40c | ||
|
661bfd4e52 | ||
|
6ac48bb0e1 | ||
|
a18b4b1505 | ||
|
b2c832e19f | ||
|
1462a8beb0 | ||
|
f877e65919 | ||
|
78898ed187 | ||
|
ef03d78c4d | ||
|
48b251273a | ||
|
c91b5e1164 | ||
|
f8fd474b55 | ||
|
bc5f43ab05 | ||
|
1da2118e13 | ||
|
67e8f5d1a7 | ||
|
2a76013ed5 | ||
|
681bbd616b | ||
|
46390a161e | ||
|
28d0ec7a2a | ||
|
8a842c57d3 | ||
|
fb333f1505 | ||
|
ab257dc7ce | ||
|
e3d8751338 | ||
|
a1532bbfea | ||
|
128963d2e9 | ||
|
1cb9fc8b43 | ||
|
b9147b7872 | ||
|
5496271000 | ||
|
16b5df4ba4 | ||
|
fee6114d74 | ||
|
b14655dd43 | ||
|
3de2890050 | ||
|
90ae3e42f6 | ||
|
158a1886fe | ||
|
d2285f0d61 | ||
|
2e44ac25a1 | ||
|
9d425039a2 | ||
|
832f04a486 | ||
|
657d5ef024 | ||
|
e92c2503d1 | ||
|
b74662cf3d | ||
|
ed3b0e81b9 | ||
|
75755c8cfc | ||
|
4ce769399f | ||
|
d0dfdcfcde | ||
|
4e949a798d | ||
|
4fb379afb4 | ||
|
eb7484c671 | ||
|
79470ffff7 | ||
|
44af6c42a2 | ||
|
d7380dc549 | ||
|
b2f6e1cf1a | ||
|
7c9437f0a9 | ||
|
162bb0a85f | ||
|
e44ccd5787 | ||
|
c4612b7484 | ||
|
731c5a2092 | ||
|
7efbd55b69 | ||
|
5dbec5b383 | ||
|
f28ad69c38 | ||
|
49a71819a1 | ||
|
ed7d11525a | ||
|
5b1dcccddc | ||
|
992a08f5ce | ||
|
49ef408699 | ||
|
0487f2fb7a | ||
|
e43c8acd30 | ||
|
97604a93dd | ||
|
d266e9e123 | ||
|
7ac8bf91df | ||
|
772d36015c | ||
|
f381211291 | ||
|
aca4cb233d | ||
|
01ef3b774f | ||
|
9041dead7f | ||
|
4ea308f75a | ||
|
e5f06eb551 | ||
|
c68030e9fa | ||
|
fd95839701 | ||
|
6305023219 | ||
|
c7dda72a84 | ||
|
7caedcb50d | ||
|
1856e09a0c | ||
|
e47568e147 | ||
|
c702ce3802 | ||
|
a37f403410 | ||
|
9248a954bd | ||
|
89a7ad6f81 | ||
|
f432f4f698 | ||
|
5ef2d5cd9f | ||
|
204612ca85 | ||
|
df8c092212 | ||
|
55d2e598db | ||
|
3c67c7b32c | ||
|
5264ffc0e5 | ||
|
27b217a4ed | ||
|
d756548ac3 | ||
|
0171e4d899 | ||
|
a2054fb7dd | ||
|
f07c9c6dcf | ||
|
c677c946ea | ||
|
87063851be | ||
|
516c1a7910 | ||
|
2293f77841 | ||
|
212771244a | ||
|
5fc33aeef5 | ||
|
fff0d1c988 | ||
|
987b5a2290 | ||
|
910d210e52 | ||
|
b719a0ee35 | ||
|
25329d2752 | ||
|
df4d80ff26 | ||
|
13ab06ecb1 | ||
|
72e2d1a2bf | ||
|
c90210c063 | ||
|
21a8726a47 | ||
|
ca7f267103 | ||
|
7b15e54b7d | ||
|
ccd007355c | ||
|
36aba02093 | ||
|
a5dd330218 | ||
|
fc0eb87620 | ||
|
0b9fca2263 | ||
|
0d9464bb92 | ||
|
ff435227e9 | ||
|
fcdc3f67af | ||
|
299936e554 | ||
|
2e192f0467 | ||
|
9062f19a97 | ||
|
f51e40a1de | ||
|
e411024696 | ||
|
01a27e22b4 | ||
|
7553c4aed9 | ||
|
593304bc43 | ||
|
a9ca30fe34 | ||
|
6030730870 | ||
|
b9436e4851 | ||
|
b0a7452d48 | ||
|
5e05e521d9 | ||
|
7a052c349a | ||
|
35aca37557 | ||
|
57fe56d72e | ||
|
218e73540a | ||
|
0965e2cc96 | ||
|
5cf4f0a82f | ||
|
9b0225db60 | ||
|
8c0959de42 | ||
|
ccd71c857f | ||
|
b89dbb0ee7 | ||
|
a5bdc1acd0 | ||
|
a279784d8d | ||
|
3a9f4f2984 | ||
|
51ae8313cf | ||
|
38f04f0073 | ||
|
f3da5d770d | ||
|
24fb13cf23 | ||
|
524e8c8410 | ||
|
52d1e44560 | ||
|
6055c5e165 | ||
|
e0ed187ea6 | ||
|
eafe048c7e | ||
|
c0e553dbb5 | ||
|
7e59987af7 | ||
|
1f012f7c46 | ||
|
d1a3d42ab8 | ||
|
05fd992c48 | ||
|
47f1d888eb | ||
|
ca9c227837 | ||
|
5df384bb71 | ||
|
e80b36347a | ||
|
9e37495493 | ||
|
77b93c5f21 | ||
|
0b198ee881 | ||
|
9e0c65881d | ||
|
c796d6a799 | ||
|
3892fb533a | ||
|
2ea7487ca7 | ||
|
d4f6cec3d0 | ||
|
b1705e283d | ||
|
eee751e22a | ||
|
2b0fefb95f | ||
|
1a627ba207 | ||
|
ea75bcf47e | ||
|
6c6dcab857 | ||
|
0654aed6c8 | ||
|
3447ca0767 | ||
|
1e858efafd | ||
|
ce88a72ea1 | ||
|
7725b8e7de | ||
|
62ddbe320d | ||
|
a694601264 | ||
|
e06f88043f | ||
|
8fc3fd146f | ||
|
ce5066bddb | ||
|
93f18e2449 | ||
|
783e62f3ca | ||
|
c38dc61021 | ||
|
45782bbb39 | ||
|
4c9cd5657e | ||
|
dc627d13b8 | ||
|
ddc3489991 | ||
|
5b24c20331 | ||
|
8bb01143d8 | ||
|
a9635da96a | ||
|
e790cb75fd | ||
|
348afeebbf | ||
|
6888553773 | ||
|
0f489672b9 | ||
|
b7d8cbfaf5 | ||
|
df8d253f78 | ||
|
89b42e3696 | ||
|
22e5a4a283 | ||
|
61810172d1 | ||
|
658c8b4be7 | ||
|
d4dab54c7b | ||
|
5566b9ba6c | ||
|
e56ab2dcd5 | ||
|
d6c45979ba | ||
|
a06e9bf32e | ||
|
7e8f7ba674 | ||
|
09eb7f7f78 | ||
|
f7a910ec66 | ||
|
6d6a73eea7 | ||
|
e4a7641927 | ||
|
b24b46d48c | ||
|
a65d7dce5b | ||
|
718a0a5d34 | ||
|
ea9e3ab3f5 | ||
|
770e988ff8 | ||
|
0fa0641974 | ||
|
c13e23cdae | ||
|
fab4ebb768 | ||
|
89429339fa | ||
|
6ed129bd7a | ||
|
c4fde6b53e | ||
|
a7d93e88b4 | ||
|
9891494142 | ||
|
f8544dfbbe | ||
|
b00651d428 | ||
|
da8dccbaca | ||
|
37272ae827 | ||
|
7f2bee46b7 | ||
|
c8a4dcf72b | ||
|
012ff91cfb | ||
|
e690ddd50a | ||
|
45b7c1948c | ||
|
e2fb7ca3d2 | ||
|
b3bda76582 | ||
|
ab6d322eca | ||
|
1a8a0df107 | ||
|
0a37709b0a | ||
|
98cd1417df | ||
|
460069ceaa | ||
|
316aa44f23 | ||
|
7133540c23 | ||
|
590231741d | ||
|
a9349b8f3d |
@@ -1,80 +0,0 @@
|
||||
version: 2
|
||||
filters:
|
||||
branches:
|
||||
only: master
|
||||
jobs:
|
||||
build:
|
||||
working_directory: ~/rocky/python-uncompyle6
|
||||
parallelism: 1
|
||||
shell: /bin/bash --login
|
||||
# CircleCI 2.0 does not support environment variables that refer to each other the same way as 1.0 did.
|
||||
# If any of these refer to each other, rewrite them so that they don't or see https://circleci.com/docs/2.0/env-vars/#interpolating-environment-variables-to-set-other-environment-variables .
|
||||
environment:
|
||||
CIRCLE_ARTIFACTS: /tmp/circleci-artifacts
|
||||
CIRCLE_TEST_REPORTS: /tmp/circleci-test-results
|
||||
COMPILE: --compile
|
||||
# To see the list of pre-built images that CircleCI provides for most common languages see
|
||||
# https://circleci.com/docs/2.0/circleci-images/
|
||||
docker:
|
||||
- image: circleci/python:3.8
|
||||
steps:
|
||||
# Machine Setup
|
||||
# If you break your build into multiple jobs with workflows, you will probably want to do the parts of this that are relevant in each
|
||||
# The following `checkout` command checks out your code to your working directory. In 1.0 we did this implicitly. In 2.0 you can choose where in the course of a job your code should be checked out.
|
||||
- checkout
|
||||
# Prepare for artifact and test results collection equivalent to how it was done on 1.0.
|
||||
# In many cases you can simplify this from what is generated here.
|
||||
# 'See docs on artifact collection here https://circleci.com/docs/2.0/artifacts/'
|
||||
- run: mkdir -p $CIRCLE_ARTIFACTS $CIRCLE_TEST_REPORTS
|
||||
# This is based on your 1.0 configuration file or project settings
|
||||
- run:
|
||||
working_directory: ~/rocky/python-uncompyle6
|
||||
command: pip install --user virtualenv && pip install --user nose && pip install
|
||||
--user pep8
|
||||
# Dependencies
|
||||
# This would typically go in either a build or a build-and-test job when using workflows
|
||||
# Restore the dependency cache
|
||||
- restore_cache:
|
||||
keys:
|
||||
- v2-dependencies-{{ .Branch }}-
|
||||
# fallback to using the latest cache if no exact match is found
|
||||
- v2-dependencies-
|
||||
|
||||
- run:
|
||||
command: | # Use pip to install dependengcies
|
||||
sudo pip install --user --upgrade setuptools
|
||||
pip install --user -e .
|
||||
# Not sure why "pip install -e" doesn't work above
|
||||
# pip install click spark-parser xdis
|
||||
pip install --user -r requirements-dev.txt
|
||||
|
||||
# Save dependency cache
|
||||
- save_cache:
|
||||
key: v2-dependencies-{{ .Branch }}-{{ epoch }}
|
||||
paths:
|
||||
# This is a broad list of cache paths to include many possible development environments
|
||||
# You can probably delete some of these entries
|
||||
- vendor/bundle
|
||||
- ~/virtualenvs
|
||||
- ~/.m2
|
||||
- ~/.ivy2
|
||||
- ~/.bundle
|
||||
- ~/.cache/bower
|
||||
|
||||
# Test
|
||||
# This would typically be a build job when using workflows, possibly combined with build
|
||||
# This is based on your 1.0 configuration file or project settings
|
||||
- run: sudo python ./setup.py develop && make check-3.6
|
||||
- run: cd ./test/stdlib && bash ./runtests.sh 'test_[p-z]*.py'
|
||||
# Teardown
|
||||
# If you break your build into multiple jobs with workflows, you will probably want to do the parts of this that are relevant in each
|
||||
# Save test results
|
||||
- store_test_results:
|
||||
path: /tmp/circleci-test-results
|
||||
# Save artifacts
|
||||
- store_artifacts:
|
||||
path: /tmp/circleci-artifacts
|
||||
- store_artifacts:
|
||||
path: /tmp/circleci-test-results
|
||||
# The resource_class feature allows configuring CPU and RAM resources for each job. Different resource classes are available for different executors. https://circleci.com/docs/2.0/configuration-reference/#resourceclass
|
||||
resource_class: large
|
31
.github/workflows/osx.yml
vendored
31
.github/workflows/osx.yml
vendored
@@ -1,31 +0,0 @@
|
||||
name: uncompyle6 (osx)
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ master ]
|
||||
pull_request:
|
||||
branches: [ master ]
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: macos-latest
|
||||
strategy:
|
||||
matrix:
|
||||
os: [macOS]
|
||||
python-version: [3.8]
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: Set up Python ${{ matrix.python-version }}
|
||||
uses: actions/setup-python@v2
|
||||
with:
|
||||
python-version: ${{ matrix.python-version }}
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
python -m pip install --upgrade pip
|
||||
pip install -e .
|
||||
# Not sure why "pip install -e" doesn't work above
|
||||
# pip install click spark-parser xdis
|
||||
pip install -r requirements-dev.txt
|
||||
- name: Test uncompyle6
|
||||
run: |
|
||||
make check
|
29
.github/workflows/ubuntu.yml
vendored
29
.github/workflows/ubuntu.yml
vendored
@@ -1,29 +0,0 @@
|
||||
name: uncompyle6 (ubuntu)
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ master ]
|
||||
pull_request:
|
||||
branches: [ master ]
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
matrix:
|
||||
python-version: [3.8]
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: Set up Python ${{ matrix.python-version }}
|
||||
uses: actions/setup-python@v2
|
||||
with:
|
||||
python-version: ${{ matrix.python-version }}
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
python -m pip install --upgrade pip
|
||||
pip install -e .
|
||||
# pip install click spark-parser xdis
|
||||
pip install -r requirements-dev.txt
|
||||
- name: Test uncompyle6
|
||||
run: |
|
||||
make check
|
31
.github/workflows/windows.yml
vendored
31
.github/workflows/windows.yml
vendored
@@ -1,31 +0,0 @@
|
||||
name: uncompyle6 (windows)
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ master ]
|
||||
pull_request:
|
||||
branches: [ master ]
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: macos-latest
|
||||
strategy:
|
||||
matrix:
|
||||
os: [windows]
|
||||
python-version: [3.8]
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: Set up Python ${{ matrix.python-version }}
|
||||
uses: actions/setup-python@v2
|
||||
with:
|
||||
python-version: ${{ matrix.python-version }}
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
python -m pip install --upgrade pip
|
||||
pip install -e .
|
||||
# Not sure why "pip install -e" doesn't work above
|
||||
# pip install click spark-parser xdis
|
||||
pip install -r requirements-dev.txt
|
||||
- name: Test uncompyle6
|
||||
run: |
|
||||
make check
|
@@ -9,14 +9,3 @@ repos:
|
||||
stages: [commit]
|
||||
- id: end-of-file-fixer
|
||||
stages: [commit]
|
||||
- repo: https://github.com/pycqa/isort
|
||||
rev: 5.13.2
|
||||
hooks:
|
||||
- id: isort
|
||||
stages: [commit]
|
||||
- repo: https://github.com/psf/black
|
||||
rev: 23.12.1
|
||||
hooks:
|
||||
- id: black
|
||||
language_version: python3
|
||||
stages: [commit]
|
||||
|
11
.travis.yml
11
.travis.yml
@@ -1,16 +1,7 @@
|
||||
language: python
|
||||
|
||||
python:
|
||||
# - '3.5'
|
||||
# - '2.7'
|
||||
# - '3.4'
|
||||
- '3.6'
|
||||
- '3.8'
|
||||
|
||||
matrix:
|
||||
include:
|
||||
- python: '3.7'
|
||||
dist: xenial # required for Python >= 3.7 (travis-ci/travis-ci#9069)
|
||||
- 2.7 # this is a cheat here because travis doesn't do 2.4-2.6
|
||||
|
||||
install:
|
||||
# Remove the next line when xdis 6.0.0 is released
|
||||
|
5
Makefile
5
Makefile
@@ -43,8 +43,9 @@ check-3.0 check-3.1 check-3.2 check-3.6:
|
||||
check-3.7: pytest
|
||||
$(MAKE) -C test check
|
||||
|
||||
check-3.8:
|
||||
$(MAKE) -C test check
|
||||
#:Tests for Python 2.4-2.5 (don't have pytest)
|
||||
check-2.4 check-2.5:
|
||||
$(MAKE) -C test $@
|
||||
|
||||
#:PyPy 2.6.1 PyPy 5.0.1, or PyPy 5.8.0-beta0
|
||||
# Skip for now
|
||||
|
158
PKG-INFO
158
PKG-INFO
@@ -7,54 +7,54 @@ Author: Rocky Bernstein, Hartmut Goebel, John Aycock, and others
|
||||
Author-email: rb@dustyfeet.com
|
||||
License: GPL3
|
||||
Description: |buildstatus| |Pypi Installs| |Latest Version| |Supported Python Versions|
|
||||
|
||||
|
||||
|packagestatus|
|
||||
|
||||
|
||||
.. contents::
|
||||
|
||||
|
||||
uncompyle6
|
||||
==========
|
||||
|
||||
|
||||
A native Python cross-version decompiler and fragment decompiler.
|
||||
The successor to decompyle, uncompyle, and uncompyle2.
|
||||
|
||||
|
||||
|
||||
|
||||
Introduction
|
||||
------------
|
||||
|
||||
|
||||
*uncompyle6* translates Python bytecode back into equivalent Python
|
||||
source code. It accepts bytecodes from Python version 1.0 to version
|
||||
3.8, spanning over 24 years of Python releases. We include Dropbox's
|
||||
Python 2.5 bytecode and some PyPy bytecodes.
|
||||
|
||||
|
||||
Why this?
|
||||
---------
|
||||
|
||||
|
||||
Ok, I'll say it: this software is amazing. It is more than your
|
||||
normal hacky decompiler. Using compiler_ technology, the program
|
||||
creates a parse tree of the program from the instructions; nodes at
|
||||
the upper levels that look a little like what might come from a Python
|
||||
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 *at run time*
|
||||
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 incorporated 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. Many of them come basically from
|
||||
the same code base, and (almost?) all of them are no longer actively
|
||||
@@ -65,148 +65,148 @@ Description: |buildstatus| |Pypi Installs| |Latest Version| |Supported Python V
|
||||
forward*. There is some serious refactoring and cleanup in this code
|
||||
base over those old forks. Even more experimental refactoring is going
|
||||
on in decompyle3_.
|
||||
|
||||
|
||||
This demonstrably does the best in decompiling Python across all
|
||||
Python versions. And even when there is another project that only
|
||||
provides decompilation for subset of Python versions, we generally do
|
||||
demonstrably better for those as well.
|
||||
|
||||
|
||||
How can we tell? By taking Python bytecode that comes distributed with
|
||||
that version of Python and decompiling these. Among those that
|
||||
successfully decompile, we can then make sure the resulting programs
|
||||
are syntactically correct by running the Python interpreter for that
|
||||
bytecode version. Finally, in cases where the program has a test for
|
||||
itself, we can run the check on the decompiled code.
|
||||
|
||||
|
||||
We use an automated processes to find 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 fixed in the other decompilers.
|
||||
|
||||
|
||||
Requirements
|
||||
------------
|
||||
|
||||
|
||||
The code in the git repository can be run from Python 2.4 to the
|
||||
latest Python version, with the exception of Python 3.0 through
|
||||
3.2. Volunteers are welcome to address these deficiencies if there a
|
||||
desire to do so.
|
||||
|
||||
|
||||
The way it does this though is by segregating consecutive Python versions into
|
||||
git branches:
|
||||
|
||||
|
||||
master
|
||||
Python 3.6 and up (uses type annotations)
|
||||
python-3.3-to-3.5
|
||||
Python 3.3 through 3.5 (Generic Python 3)
|
||||
python-2.4
|
||||
Python 2.4 through 2.7 (Generic Python 2)
|
||||
|
||||
|
||||
PyPy 3-2.4 and later works as well.
|
||||
|
||||
|
||||
The bytecode files it can read have been tested on Python
|
||||
bytecodes from versions 1.4, 2.1-2.7, and 3.0-3.8 and later PyPy
|
||||
versions.
|
||||
|
||||
|
||||
Installation
|
||||
------------
|
||||
|
||||
|
||||
You can install from PyPI using the name ``uncompyle6``::
|
||||
|
||||
|
||||
pip install uncompyle6
|
||||
|
||||
|
||||
|
||||
|
||||
To install from source code, this project uses setup.py, so it follows the standard Python routine::
|
||||
|
||||
|
||||
$ pip install -e . # set up to run from source tree
|
||||
|
||||
|
||||
or::
|
||||
|
||||
|
||||
$ python setup.py install # may need sudo
|
||||
|
||||
|
||||
A GNU Makefile is also provided so :code:`make install` (possibly as root or
|
||||
sudo) will do the steps above.
|
||||
|
||||
|
||||
Running Tests
|
||||
-------------
|
||||
|
||||
|
||||
::
|
||||
|
||||
|
||||
make check
|
||||
|
||||
|
||||
A GNU makefile has been added to smooth over setting running the right
|
||||
command, and running tests from fastest to slowest.
|
||||
|
||||
|
||||
If you have remake_ installed, you can see the list of all tasks
|
||||
including tests via :code:`remake --tasks`
|
||||
|
||||
|
||||
|
||||
|
||||
Usage
|
||||
-----
|
||||
|
||||
|
||||
Run
|
||||
|
||||
|
||||
::
|
||||
|
||||
|
||||
$ uncompyle6 *compiled-python-file-pyc-or-pyo*
|
||||
|
||||
|
||||
For usage help:
|
||||
|
||||
|
||||
::
|
||||
|
||||
|
||||
$ uncompyle6 -h
|
||||
|
||||
|
||||
Verification
|
||||
------------
|
||||
|
||||
|
||||
In older versions of Python it was possible to verify bytecode by
|
||||
decompiling bytecode, and then compiling using the Python interpreter
|
||||
for that bytecode version. Having done this, the bytecode produced
|
||||
could be compared with the original bytecode. However as Python's code
|
||||
generation got better, this no longer was feasible.
|
||||
|
||||
|
||||
If you want Python syntax verification of the correctness of the
|
||||
decompilation process, add the :code:`--syntax-verify` option. However since
|
||||
Python syntax changes, you should use this option if the bytecode is
|
||||
the right bytecode for the Python interpreter that will be checking
|
||||
the syntax.
|
||||
|
||||
|
||||
You can also cross compare the results with another version of
|
||||
`uncompyle6` since there are sometimes regressions in decompiling
|
||||
specific bytecode as the overall quality improves.
|
||||
|
||||
|
||||
For Python 3.7 and 3.8, the code in decompyle3_ is generally
|
||||
better.
|
||||
|
||||
|
||||
Or try specific another python decompiler like uncompyle2_, unpyc37_,
|
||||
or pycdc_. Since the later two work differently, bugs here often
|
||||
aren't in that, and vice versa.
|
||||
|
||||
|
||||
There is an interesting class of these programs that is readily
|
||||
available give stronger verification: those programs that when run
|
||||
test themselves. Our test suite includes these.
|
||||
|
||||
|
||||
And Python comes with another a set of programs like this: its test
|
||||
suite for the standard library. We have some code in :code:`test/stdlib` to
|
||||
facilitate this kind of checking too.
|
||||
|
||||
|
||||
Known Bugs/Restrictions
|
||||
-----------------------
|
||||
|
||||
|
||||
The biggest known and possibly fixable (but hard) problem has to do
|
||||
with handling control flow. (Python has probably the most diverse and
|
||||
screwy set of compound statements I've ever seen; there
|
||||
are "else" clauses on loops and try blocks that I suspect many
|
||||
programmers don't know about.)
|
||||
|
||||
|
||||
All of the Python decompilers that I have looked at have problems
|
||||
decompiling Python's control flow. In some cases we can detect an
|
||||
erroneous decompilation and report that.
|
||||
|
||||
|
||||
Python support is pretty good for Python 2
|
||||
|
||||
|
||||
On the lower end of Python versions, decompilation seems pretty good although
|
||||
we don't have any automated testing in place for Python's distributed tests.
|
||||
Also, we don't have a Python interpreter for versions 1.6, and 2.0.
|
||||
|
||||
|
||||
In the Python 3 series, Python support is strongest around 3.4 or
|
||||
3.3 and drops off as you move further away from those versions. Python
|
||||
3.0 is weird in that it in some ways resembles 2.6 more than it does
|
||||
@@ -218,43 +218,43 @@ Description: |buildstatus| |Pypi Installs| |Latest Version| |Supported Python V
|
||||
:code:`EXTENDED_ARG` instructions, additional jump optimization has been
|
||||
added. So in sum handling control flow by ad hoc means as is currently
|
||||
done is worse.
|
||||
|
||||
|
||||
Between Python 3.5, 3.6, 3.7 there have been major changes to the
|
||||
:code:`MAKE_FUNCTION` and :code:`CALL_FUNCTION` instructions.
|
||||
|
||||
|
||||
Python 3.8 removes :code:`SETUP_LOOP`, :code:`SETUP_EXCEPT`,
|
||||
:code:`BREAK_LOOP`, and :code:`CONTINUE_LOOP`, instructions which may
|
||||
make control-flow detection harder, lacking the more sophisticated
|
||||
control-flow analysis that is planned. We'll see.
|
||||
|
||||
|
||||
Currently not all Python magic numbers are supported. Specifically in
|
||||
some versions of Python, notably Python 3.6, the magic number has
|
||||
changes several times within a version.
|
||||
|
||||
|
||||
**We support only released versions, not candidate versions.** Note
|
||||
however that the magic of a released version is usually the same as
|
||||
the *last* candidate version prior to release.
|
||||
|
||||
|
||||
There are also customized Python interpreters, notably Dropbox,
|
||||
which use their own magic and encrypt bytecode. With the exception of
|
||||
the Dropbox's old Python 2.5 interpreter this kind of thing is not
|
||||
handled.
|
||||
|
||||
|
||||
We also don't handle PJOrion_ or otherwise obfuscated code. For
|
||||
PJOrion try: PJOrion Deobfuscator_ to unscramble the bytecode to get
|
||||
valid bytecode before trying this tool; pydecipher_ might help with that.
|
||||
|
||||
|
||||
This program can't decompile Microsoft Windows EXE files created by
|
||||
Py2EXE_, although we can probably decompile the code after you extract
|
||||
the bytecode properly. `Pydeinstaller <https://github.com/charles-dyfis-net/pydeinstaller>`_ may help with unpacking Pyinstaller bundlers.
|
||||
|
||||
|
||||
Handling pathologically long lists of expressions or statements is
|
||||
slow. We don't handle Cython_ or MicroPython which don't use bytecode.
|
||||
|
||||
|
||||
There are numerous bugs in decompilation. And that's true for every
|
||||
other CPython decompiler I have encountered, even the ones that
|
||||
claimed to be "perfect" on some particular version like 2.4.
|
||||
|
||||
|
||||
As Python progresses decompilation also gets harder because the
|
||||
compilation is more sophisticated and the language itself is more
|
||||
sophisticated. I suspect that attempts there will be fewer ad-hoc
|
||||
@@ -265,28 +265,28 @@ Description: |buildstatus| |Pypi Installs| |Latest Version| |Supported Python V
|
||||
project is better funded, I do not intend to make any serious effort
|
||||
to support Python versions 3.8 or 3.9, including bugs that might come
|
||||
in. I imagine at some point I may be interested in it.
|
||||
|
||||
|
||||
You can easily find bugs by running the tests against the standard
|
||||
test suite that Python uses to check itself. At any given time, there are
|
||||
dozens of known problems that are pretty well isolated and that could
|
||||
be solved if one were to put in the time to do so. The problem is that
|
||||
there aren't that many people who have been working on bug fixing.
|
||||
|
||||
|
||||
Some of the bugs in 3.7 and 3.8 are simply a matter of back-porting
|
||||
the fixes in decompyle3. Volunteers are welcome to do so.
|
||||
|
||||
|
||||
You may run across a bug, that you want to report. Please do so after
|
||||
reading `How to report a bug
|
||||
<https://github.com/rocky/python-uncompyle6/blob/master/HOW-TO-REPORT-A-BUG.md>`_ and
|
||||
follow the `instructions when opening an issue <https://github.com/rocky/python-uncompyle6/issues/new?assignees=&labels=&template=bug-report.md>`_.
|
||||
|
||||
|
||||
Be aware that it might not get my attention for a while. If you
|
||||
sponsor or support the project in some way, I'll prioritize your
|
||||
issues above the queue of other things I might be doing instead.
|
||||
|
||||
|
||||
See Also
|
||||
--------
|
||||
|
||||
|
||||
* https://github.com/rocky/python-decompile3 : Much smaller and more modern code, focusing on 3.7 and 3.8. Changes in that will get migrated back 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. Currently unmaintained.
|
||||
* https://github.com/figment/unpyc3/ : fork of above, but supports Python 3.3 only. Includes some fixes like supporting function annotations. Currently unmaintained.
|
||||
@@ -297,8 +297,8 @@ Description: |buildstatus| |Pypi Installs| |Latest Version| |Supported Python V
|
||||
* 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
|
||||
* https://github.com/zrax/pycdc : The README for this C++ code says it aims to support all versions of Python. You can aim your slign shot for the moon too, but I doubt you are going to hit it. This code is best for Python versions around 2.7 and 3.3 when the code was initially developed. Accuracy for current versions of Python3 and early versions of Python is lacking. Without major effort, it is unlikely it can be made to support current Python 3. See its `issue tracker <https://github.com/zrax/pycdc/issues>`_ for details. Currently lightly maintained.
|
||||
|
||||
|
||||
|
||||
|
||||
.. _Cython: https://en.wikipedia.org/wiki/Cython
|
||||
.. _trepan: https://pypi.python.org/pypi/trepan3k
|
||||
.. _compiler: https://github.com/rocky/python-uncompyle6/wiki/How-does-this-code-work%3F
|
||||
@@ -323,9 +323,9 @@ Description: |buildstatus| |Pypi Installs| |Latest Version| |Supported Python V
|
||||
.. |Latest Version| image:: https://badge.fury.io/py/uncompyle6.svg
|
||||
:target: https://badge.fury.io/py/uncompyle6
|
||||
.. |Pypi Installs| image:: https://pepy.tech/badge/uncompyle6/month
|
||||
|
||||
|
||||
Platform: UNKNOWN
|
||||
|
||||
|
||||
Platform: uncompyle6
|
||||
Classifier: Development Status :: 5 - Production/Stable
|
||||
Classifier: Intended Audience :: Developers
|
||||
Classifier: License :: OSI Approved :: GNU General Public License v3 (GPLv3)
|
||||
|
17
README.rst
17
README.rst
@@ -103,16 +103,16 @@ Installation
|
||||
|
||||
You can install from PyPI using the name ``uncompyle6``::
|
||||
|
||||
pip install uncompyle6
|
||||
$ pip install uncompyle6
|
||||
|
||||
|
||||
To install from source code, this project uses setup.py, so it follows the standard Python routine::
|
||||
|
||||
$ pip install -e . # set up to run from source tree
|
||||
$ pip install -e . # set up to run from source tree
|
||||
|
||||
or::
|
||||
|
||||
$ python setup.py install # may need sudo
|
||||
$ python setup.py install # may need sudo
|
||||
|
||||
A GNU Makefile is also provided so :code:`make install` (possibly as root or
|
||||
sudo) will do the steps above.
|
||||
@@ -122,7 +122,7 @@ Running Tests
|
||||
|
||||
::
|
||||
|
||||
make check
|
||||
$ make check
|
||||
|
||||
A GNU makefile has been added to smooth over setting running the right
|
||||
command, and running tests from fastest to slowest.
|
||||
@@ -306,15 +306,12 @@ See Also
|
||||
.. _uncompyle2: https://github.com/wibiti/uncompyle2
|
||||
.. _unpyc37: https://github.com/andrew-tavera/unpyc37
|
||||
.. _this: https://github.com/rocky/python-uncompyle6/wiki/Deparsing-technology-and-its-use-in-exact-location-reporting
|
||||
.. |buildstatus| image:: https://travis-ci.org/rocky/python-uncompyle6.svg
|
||||
:target: https://travis-ci.org/rocky/python-uncompyle6
|
||||
.. |packagestatus| image:: https://repology.org/badge/vertical-allrepos/python:uncompyle6.svg
|
||||
:target: https://repology.org/project/python:uncompyle6/versions
|
||||
.. |buildstatus| image:: https://travis-ci.org/rocky/python-uncompyle6.svg :target: https://travis-ci.org/rocky/python-uncompyle6
|
||||
.. |packagestatus| image:: https://repology.org/badge/vertical-allrepos/python:uncompyle6.svg :target: https://repology.org/project/python:uncompyle6/versions
|
||||
.. _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
|
||||
.. _pydecipher: https://github.com/mitre/pydecipher
|
||||
.. _Deobfuscator: https://github.com/extremecoders-re/PjOrion-Deobfuscator
|
||||
.. _Py2EXE: https://en.wikipedia.org/wiki/Py2exe
|
||||
.. |Supported Python Versions| image:: https://img.shields.io/pypi/pyversions/uncompyle6.svg
|
||||
.. |Latest Version| image:: https://badge.fury.io/py/uncompyle6.svg
|
||||
:target: https://badge.fury.io/py/uncompyle6
|
||||
.. |Latest Version| image:: https://badge.fury.io/py/uncompyle6.svg :target: https://badge.fury.io/py/uncompyle6
|
||||
.. |Pypi Installs| image:: https://pepy.tech/badge/uncompyle6/month
|
||||
|
@@ -79,7 +79,7 @@ entry_points = {
|
||||
]
|
||||
}
|
||||
ftp_url = None
|
||||
install_requires = ["click", "spark-parser >= 1.8.9, < 1.9.0", "xdis >= 6.1.1, < 6.2.0"]
|
||||
install_requires = ["spark-parser >= 1.8.9, < 1.9.0", "xdis >= 6.1.1, < 6.2.0"]
|
||||
|
||||
license = "GPL3"
|
||||
mailing_list = "python-debugger@googlegroups.com"
|
||||
|
@@ -12,8 +12,6 @@ if ! source ./pyenv-2.4-2.7-versions ; then
|
||||
exit $?
|
||||
fi
|
||||
if ! source ./setup-python-2.4.sh ; then
|
||||
rc=$?
|
||||
finish
|
||||
exit $rc
|
||||
fi
|
||||
|
||||
@@ -25,8 +23,6 @@ for version in $PYVERSIONS; do
|
||||
fi
|
||||
make clean && python setup.py develop
|
||||
if ! make check ; then
|
||||
finish
|
||||
rc=$?
|
||||
exit $?
|
||||
fi
|
||||
echo === $version ===
|
||||
|
0
admin-tools/check-3.3-3.5-versions.sh
Normal file → Executable file
0
admin-tools/check-3.3-3.5-versions.sh
Normal file → Executable file
46
admin-tools/how-to-make-a-release.txt
Normal file
46
admin-tools/how-to-make-a-release.txt
Normal file
@@ -0,0 +1,46 @@
|
||||
git pull
|
||||
|
||||
Change version in uncompyle6/version.py
|
||||
source uncompyle6/version.py
|
||||
echo $VERSION
|
||||
git commit -m"Get ready for release $VERSION" .
|
||||
|
||||
Update ChangeLog:
|
||||
make ChangeLog
|
||||
|
||||
Update NEWS from ChangeLog
|
||||
make check
|
||||
|
||||
git commit --amend .
|
||||
|
||||
git push
|
||||
|
||||
Make sure pyenv is running
|
||||
# Pyenv
|
||||
|
||||
source admin-tools/check-newer-versions.sh
|
||||
|
||||
|
||||
# Switch to python-2.4 and build that first...
|
||||
source admin-tools/setup-python-2.4
|
||||
|
||||
rm ChangeLog
|
||||
git merge master
|
||||
|
||||
Update NEWS from master branch
|
||||
|
||||
git commit -m"Get ready for release $VERSION" .
|
||||
|
||||
source admin-tools/check-older-versions.sh
|
||||
source admin-tools/check-newer-versions.sh
|
||||
|
||||
make-dist-older.sh
|
||||
|
||||
git tag release-python-2.4-$VERSION
|
||||
|
||||
./make-dist-newer.sh
|
||||
|
||||
git tag release-$VERSION
|
||||
|
||||
|
||||
twine upload dist/uncompyle6-${VERSION}*
|
0
admin-tools/make-dist-3.0-3.2.sh
Normal file → Executable file
0
admin-tools/make-dist-3.0-3.2.sh
Normal file → Executable file
@@ -5,4 +5,4 @@ if [[ $0 == ${BASH_SOURCE[0]} ]] ; then
|
||||
echo "This script should be *sourced* rather than run directly through bash"
|
||||
exit 1
|
||||
fi
|
||||
export PYVERSIONS='3.5.10 3.3.7 3.4.10'
|
||||
export PYVERSIONS=' 3.3.7 3.4.10 3.5.10 '
|
||||
|
0
admin-tools/setup-master.sh
Executable file → Normal file
0
admin-tools/setup-master.sh
Executable file → Normal file
0
admin-tools/setup-python-2.4.sh
Executable file → Normal file
0
admin-tools/setup-python-2.4.sh
Executable file → Normal file
0
admin-tools/setup-python-3.3.sh
Executable file → Normal file
0
admin-tools/setup-python-3.3.sh
Executable file → Normal file
3
admin-tools/update-sources.sh
Executable file
3
admin-tools/update-sources.sh
Executable file
@@ -0,0 +1,3 @@
|
||||
#!/bin/bash
|
||||
cd $(dirname ${BASH_SOURCE[0]})/..
|
||||
git pull
|
@@ -1,64 +0,0 @@
|
||||
[build-system]
|
||||
requires = [
|
||||
"setuptools>=71.0.3",
|
||||
]
|
||||
|
||||
build-backend = "setuptools.build_meta"
|
||||
|
||||
[project]
|
||||
authors = [
|
||||
{name = "Rocky Bernstein", email = "rb@dustyfeet.com"},
|
||||
]
|
||||
|
||||
name = "uncompyle6"
|
||||
description = "Python cross-version byte-code library and disassembler"
|
||||
dependencies = [
|
||||
"click",
|
||||
"spark-parser >= 1.8.9, < 1.9.0",
|
||||
"xdis >= 6.1.0, < 6.2.0",
|
||||
]
|
||||
readme = "README.rst"
|
||||
license = {text = "GPL"}
|
||||
keywords = ["Python bytecode", "bytecode", "disassembler"]
|
||||
classifiers = [
|
||||
"Development Status :: 5 - Production/Stable",
|
||||
"Intended Audience :: Developers",
|
||||
"License :: OSI Approved :: MIT License",
|
||||
"Programming Language :: Python",
|
||||
"Topic :: Software Development :: Libraries :: Python Modules",
|
||||
"Programming Language :: Python :: 2.4",
|
||||
"Programming Language :: Python :: 2.5",
|
||||
"Programming Language :: Python :: 2.6",
|
||||
"Programming Language :: Python :: 2.7",
|
||||
"Programming Language :: Python :: 3.0",
|
||||
"Programming Language :: Python :: 3.1",
|
||||
"Programming Language :: Python :: 3.2",
|
||||
"Programming Language :: Python :: 3.3",
|
||||
"Programming Language :: Python :: 3.4",
|
||||
"Programming Language :: Python :: 3.5",
|
||||
"Programming Language :: Python :: 3.6",
|
||||
"Programming Language :: Python :: 3.7",
|
||||
"Programming Language :: Python :: 3.8",
|
||||
"Programming Language :: Python :: 3.9",
|
||||
"Programming Language :: Python :: 3.10",
|
||||
"Programming Language :: Python :: 3.11",
|
||||
"Programming Language :: Python :: 3.12",
|
||||
]
|
||||
dynamic = ["version"]
|
||||
|
||||
[project.urls]
|
||||
Homepage = "https://github.com/rocky/python-uncompyle6"
|
||||
Downloads = "https://github.com/rocky/python-uncompyle6/releases"
|
||||
|
||||
[project.optional-dependencies]
|
||||
dev = [
|
||||
"pre-commit",
|
||||
"pytest",
|
||||
]
|
||||
|
||||
[project.scripts]
|
||||
uncompyle6 = "uncompyle6.bin.uncompile:main_bin"
|
||||
uncompyle6-tokenize = "uncompyle6.bin.pydisassemble:main"
|
||||
|
||||
[tool.setuptools.dynamic]
|
||||
version = {attr = "uncompyle6.version.__version__"}
|
@@ -29,7 +29,7 @@ def list_comp():
|
||||
[y for y in range(3)]
|
||||
|
||||
def get_parsed_for_fn(fn):
|
||||
code = fn.__code__
|
||||
code = fn.func_code
|
||||
return deparse(code, version=PYTHON_VERSION_TRIPLE)
|
||||
|
||||
def check_expect(expect, parsed, fn_name):
|
||||
@@ -316,3 +316,4 @@ for i in range(2): ...
|
||||
.
|
||||
""".split("\n")
|
||||
parsed = get_parsed_for_fn(for_range_stmt)
|
||||
check_expect(expect, parsed, 'range_stmt')
|
||||
|
@@ -20,7 +20,7 @@ def bug_loop(disassemble, tb=None):
|
||||
disassemble(tb)
|
||||
|
||||
def test_if_in_for():
|
||||
code = bug.__code__
|
||||
code = bug.func_code
|
||||
scan = get_scanner(PYTHON_VERSION_TRIPLE)
|
||||
if (2, 7) <= PYTHON_VERSION_TRIPLE < (3, 1) and not IS_PYPY:
|
||||
scan.build_instructions(code)
|
||||
|
@@ -1,7 +1,9 @@
|
||||
import re
|
||||
|
||||
from xdis.version_info import IS_PYPY, PYTHON_VERSION_TRIPLE
|
||||
|
||||
from uncompyle6.parser import get_python_parser, python_parser
|
||||
from uncompyle6.scanner import get_scanner
|
||||
from xdis.version_info import PYTHON_VERSION_TRIPLE, IS_PYPY
|
||||
|
||||
|
||||
def test_grammar():
|
||||
@@ -28,7 +30,7 @@ def test_grammar():
|
||||
|
||||
expect_lhs.add("get_iter")
|
||||
|
||||
if PYTHON_VERSION_TRIPLE >= (3, 8) or PYTHON_VERSION_TRIPLE < (3, 0):
|
||||
if PYTHON_VERSION_TRIPLE >= (3, 8):
|
||||
expect_lhs.add("stmts_opt")
|
||||
else:
|
||||
expect_lhs.add("async_with_as_stmt")
|
||||
@@ -45,28 +47,34 @@ def test_grammar():
|
||||
expect_lhs.add("kvlist")
|
||||
expect_lhs.add("kv3")
|
||||
unused_rhs.add("dict")
|
||||
|
||||
if PYTHON_VERSION_TRIPLE < (3, 7) and PYTHON_VERSION_TRIPLE[:2] != (2, 7):
|
||||
else:
|
||||
if PYTHON_VERSION_TRIPLE < (3, 7) and PYTHON_VERSION_TRIPLE[:2] not in (
|
||||
(2, 7),
|
||||
(2, 6),
|
||||
):
|
||||
# NOTE: this may disappear
|
||||
expect_lhs.add("except_handler_else")
|
||||
|
||||
expect_lhs.add("load_genexpr")
|
||||
expect_lhs.add("kwarg")
|
||||
if PYTHON_VERSION_TRIPLE >= (3, 0):
|
||||
expect_lhs.add("load_genexpr")
|
||||
|
||||
unused_rhs = unused_rhs.union(
|
||||
set(
|
||||
"""
|
||||
except_pop_except generator_exp
|
||||
""".split()
|
||||
unused_rhs = unused_rhs.union(
|
||||
set(
|
||||
"""
|
||||
except_pop_except generator_exp
|
||||
""".split()
|
||||
)
|
||||
)
|
||||
)
|
||||
if PYTHON_VERSION_TRIPLE < (3, 7):
|
||||
expect_lhs.add("annotate_arg")
|
||||
expect_lhs.add("annotate_tuple")
|
||||
unused_rhs.add("mkfunc_annotate")
|
||||
if PYTHON_VERSION_TRIPLE < (3, 7):
|
||||
expect_lhs.add("annotate_arg")
|
||||
expect_lhs.add("annotate_tuple")
|
||||
unused_rhs.add("mkfunc_annotate")
|
||||
|
||||
unused_rhs.add("dict_comp")
|
||||
unused_rhs.add("classdefdeco1")
|
||||
unused_rhs.add("tryelsestmtl")
|
||||
|
||||
unused_rhs.add("dict_comp")
|
||||
unused_rhs.add("classdefdeco1")
|
||||
unused_rhs.add("tryelsestmtl")
|
||||
if PYTHON_VERSION_TRIPLE >= (3, 5):
|
||||
expect_right_recursive.add(
|
||||
(("l_stmts", ("lastl_stmt", "come_froms", "l_stmts")))
|
||||
@@ -98,7 +106,9 @@ def test_grammar():
|
||||
)
|
||||
reduced_dup_rhs = dict((k, dup_rhs[k]) for k in dup_rhs if k not in expect_dup_rhs)
|
||||
if reduced_dup_rhs:
|
||||
print("\nPossible duplicate RHS that might be folded, into one of the LHS symbols")
|
||||
print(
|
||||
"\nPossible duplicate RHS that might be folded, into one of the LHS symbols"
|
||||
)
|
||||
for k in reduced_dup_rhs:
|
||||
print(k, reduced_dup_rhs[k])
|
||||
# assert not reduced_dup_rhs, reduced_dup_rhs
|
||||
@@ -123,6 +133,7 @@ def test_grammar():
|
||||
opcode_set.add("THEN")
|
||||
check_tokens(tokens, opcode_set)
|
||||
elif PYTHON_VERSION_TRIPLE[:2] == (3, 4):
|
||||
ignore_set.add("LOAD_ARG") # Used in grammar for comprehension. But not in 3.4
|
||||
ignore_set.add("LOAD_CLASSNAME")
|
||||
ignore_set.add("STORE_LOCALS")
|
||||
opcode_set = set(s.opc.opname).union(ignore_set)
|
||||
|
@@ -5,9 +5,7 @@ from uncompyle6.semantics.consts import (
|
||||
# RETURN_NONE, PASS, RETURN_LOCALS
|
||||
)
|
||||
|
||||
from io import StringIO
|
||||
def iteritems(d):
|
||||
return d.items()
|
||||
from StringIO import StringIO
|
||||
|
||||
from uncompyle6.semantics.pysource import (SourceWalker, deparse_code2str)
|
||||
|
||||
@@ -24,7 +22,7 @@ def test_template_engine():
|
||||
# FIXME: and so on...
|
||||
|
||||
from uncompyle6.semantics.consts import (
|
||||
TABLE_DIRECT, TABLE_R,
|
||||
TABLE_R, TABLE_DIRECT,
|
||||
)
|
||||
|
||||
from uncompyle6.semantics.fragments import (
|
||||
@@ -38,7 +36,7 @@ def test_tables():
|
||||
(TABLE_DIRECT, 'TABLE_DIRECT', False),
|
||||
(TABLE_R, 'TABLE_R', False),
|
||||
(TABLE_DIRECT_FRAGMENT, 'TABLE_DIRECT_FRAGMENT', True)):
|
||||
for k, entry in iteritems(t):
|
||||
for k, entry in t.iteritems():
|
||||
if k in skip_for_now:
|
||||
continue
|
||||
fmt = entry[0]
|
||||
|
@@ -1,22 +1,20 @@
|
||||
import pytest
|
||||
from uncompyle6 import code_deparse
|
||||
from xdis.version_info import PYTHON_VERSION_TRIPLE
|
||||
|
||||
pytest.mark.skip(PYTHON_VERSION_TRIPLE < (2, 7), reason="need Python < 2.7")
|
||||
|
||||
|
||||
def test_single_mode():
|
||||
single_expressions = (
|
||||
"i = 1",
|
||||
"i and (j or k)",
|
||||
"i += 1",
|
||||
"i = j % 4",
|
||||
"i = {}",
|
||||
"i = []",
|
||||
"for i in range(10):\n i\n",
|
||||
"for i in range(10):\n for j in range(10):\n i + j\n",
|
||||
# 'try:\n i\nexcept Exception:\n j\nelse:\n k\n'
|
||||
)
|
||||
if PYTHON_VERSION_TRIPLE == (2, 7):
|
||||
def test_single_mode():
|
||||
single_expressions = (
|
||||
'i = 1',
|
||||
'i and (j or k)',
|
||||
'i += 1',
|
||||
'i = j % 4',
|
||||
'i = {}',
|
||||
'i = []',
|
||||
'for i in range(10):\n i\n',
|
||||
'for i in range(10):\n for j in range(10):\n i + j\n',
|
||||
'try:\n i\nexcept Exception:\n j\nelse:\n k\n'
|
||||
)
|
||||
|
||||
for expr in single_expressions:
|
||||
code = compile(expr + "\n", "<string>", "single")
|
||||
|
2
pytest/testdata/if-2.7.right
vendored
2
pytest/testdata/if-2.7.right
vendored
@@ -9,4 +9,4 @@
|
||||
12 JUMP_FORWARD 0 'to 15'
|
||||
15_0 COME_FROM 12 '12'
|
||||
15 LOAD_CONST None
|
||||
18 RETURN_VALUE
|
||||
18 RETURN_VALUE
|
||||
|
2
pytest/testdata/ifelse-2.7.right
vendored
2
pytest/testdata/ifelse-2.7.right
vendored
@@ -12,4 +12,4 @@
|
||||
18 STORE_NAME 2 'd'
|
||||
21_0 COME_FROM 12 '12'
|
||||
21 LOAD_CONST None
|
||||
24 RETURN_VALUE
|
||||
24 RETURN_VALUE
|
||||
|
@@ -17,6 +17,12 @@ from xdis import Bytecode, get_opcode
|
||||
|
||||
opc = get_opcode(PYTHON_VERSION_TRIPLE, IS_PYPY)
|
||||
Bytecode = functools.partial(Bytecode, opc=opc)
|
||||
|
||||
if PYTHON_VERSION_TRIPLE < (2, 5):
|
||||
from cStringIO import StringIO
|
||||
else:
|
||||
from StringIO import StringIO
|
||||
|
||||
import six
|
||||
|
||||
def _dis_to_text(co):
|
||||
@@ -122,7 +128,7 @@ def validate_uncompyle(text, mode="exec"):
|
||||
original_text = text
|
||||
|
||||
deparsed = code_deparse(
|
||||
original_code, out=six.StringIO(), version=PYTHON_VERSION_TRIPLE, compile_mode=mode
|
||||
original_code, out=StringIO(), version=PYTHON_VERSION_TRIPLE, compile_mode=mode
|
||||
)
|
||||
uncompyled_text = deparsed.text
|
||||
uncompyled_code = compile(uncompyled_text, "<string>", "exec")
|
||||
|
@@ -1,9 +1,7 @@
|
||||
# Pick up stuff from setup.py
|
||||
hypothesis==2.0.0
|
||||
pytest
|
||||
-e .
|
||||
|
||||
Click~=7.0
|
||||
xdis>=6.0.4
|
||||
xdis >= 6.1.0, < 6.2.0
|
||||
configobj~=5.0.6
|
||||
setuptools~=71.0.3
|
||||
setuptools~=59.6.0
|
||||
|
61
setup.py
61
setup.py
@@ -1,6 +1,63 @@
|
||||
#!/usr/bin/env python
|
||||
"""Setup script for the 'uncompyle6' distribution."""
|
||||
|
||||
from setuptools import setup
|
||||
import setuptools
|
||||
import sys
|
||||
|
||||
setup(packages=["uncompyle6"])
|
||||
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, 6) <= SYS_VERSION < (3, 9)):
|
||||
mess += ("\nFor your Python, version %s, use the master code/branch." %
|
||||
sys.version[0:3])
|
||||
elif (3, 3) <= SYS_VERSION <= (3, 6):
|
||||
mess += (
|
||||
"\nFor your Python, version %s, use the python-3.3-3.5 code/branch."
|
||||
% sys.version[0:3]
|
||||
)
|
||||
elif (3, 0) >= SYS_VERSION < (3, 3):
|
||||
mess += (
|
||||
"\nFor your Python, version %s, use the python-3.0-to-3.2 code/branch."
|
||||
% sys.version[0:3]
|
||||
)
|
||||
elif SYS_VERSION < (2, 4):
|
||||
mess += (
|
||||
"\nThis package is not supported for Python before Python 2.4 version %s." % sys.version[0:3]
|
||||
)
|
||||
print(mess)
|
||||
raise Exception(mess)
|
||||
|
||||
from __pkginfo__ import (
|
||||
__version__,
|
||||
author,
|
||||
author_email,
|
||||
classifiers,
|
||||
entry_points,
|
||||
install_requires,
|
||||
license,
|
||||
long_description,
|
||||
modname,
|
||||
py_modules,
|
||||
short_desc,
|
||||
web,
|
||||
zip_safe,
|
||||
)
|
||||
|
||||
setuptools.setup(
|
||||
author=author,
|
||||
author_email=author_email,
|
||||
classifiers=classifiers,
|
||||
description=short_desc,
|
||||
entry_points=entry_points,
|
||||
install_requires=install_requires,
|
||||
license=license,
|
||||
long_description=long_description,
|
||||
long_description_content_type="text/x-rst",
|
||||
name=modname,
|
||||
packages=setuptools.find_packages(),
|
||||
py_modules=py_modules,
|
||||
test_suite="nose.collector",
|
||||
url=web,
|
||||
version=__version__,
|
||||
zip_safe=zip_safe,
|
||||
)
|
||||
|
85
test-unit/test_grammar.py
Normal file
85
test-unit/test_grammar.py
Normal file
@@ -0,0 +1,85 @@
|
||||
import re
|
||||
import unittest
|
||||
|
||||
from xdis.version_info import IS_PYPY, PYTHON_VERSION_TRIPLE
|
||||
|
||||
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_TRIPLE, is_pypy=IS_PYPY)
|
||||
(lhs, rhs, tokens, right_recursive, dup_rhs) = p.check_sets()
|
||||
expect_lhs = set(["pos_arg", "get_iter", "attribute"])
|
||||
unused_rhs = set(["list", "call", "mkfunc", "unpack", "lambda_body"])
|
||||
|
||||
expect_right_recursive = frozenset(
|
||||
[("designList", ("store", "DUP_TOP", "designList"))]
|
||||
)
|
||||
expect_lhs.add("kwarg")
|
||||
|
||||
if PYTHON_VERSION_TRIPLE[:2] <= (3, 6):
|
||||
unused_rhs.add("call")
|
||||
|
||||
if PYTHON_VERSION_TRIPLE[:2] == (2, 7):
|
||||
expect_lhs.add("kv3")
|
||||
expect_lhs.add("kvlist")
|
||||
unused_rhs.add("dict")
|
||||
|
||||
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
|
||||
|
||||
# FIXME: Something got borked here
|
||||
def no_test_dup_rule(self):
|
||||
import inspect
|
||||
|
||||
python_parser(
|
||||
PYTHON_VERSION_TRIPLE,
|
||||
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()
|
@@ -30,55 +30,46 @@ check:
|
||||
$(MAKE) check-$(PYTHON_VERSION)
|
||||
|
||||
#: Run working tests from Python 2.6 or 2.7
|
||||
check-2.6 check-2.7: check-bytecode-2 check-bytecode-3 check-bytecode-1 check-native-short
|
||||
check-2.4 check-2.5 check-2.6 check-2.7: check-bytecode-2 check-bytecode-3 check-bytecode-1 check-native-short
|
||||
|
||||
#: Run working tests from Python 3.0
|
||||
check-3.0: check-bytecode
|
||||
$(PYTHON) test_pythonlib.py --bytecode-3.0-run --verify-run
|
||||
$(PYTHON) test_pythonlib.py --bytecode-3.0 --syntax-verify $(COMPILE)
|
||||
$(PYTHON) test_pythonlib.py --bytecode-3.0-run
|
||||
|
||||
#: Run working tests from Python 3.1
|
||||
check-3.1: check-bytecode
|
||||
$(PYTHON) test_pythonlib.py --bytecode-3.1-run --verify-run
|
||||
$(PYTHON) test_pythonlib.py --bytecode-3.1 --syntax-verify $(COMPILE)
|
||||
$(PYTHON) test_pythonlib.py --bytecode-3.1-run
|
||||
|
||||
#: Run working tests from Python 3.2
|
||||
check-3.2: check-bytecode
|
||||
$(PYTHON) test_pythonlib.py --bytecode-3.2-run --verify-run
|
||||
$(PYTHON) test_pythonlib.py --bytecode-3.2 --syntax-verify $(COMPILE)
|
||||
$(PYTHON) test_pythonlib.py --bytecode-3.2-run
|
||||
|
||||
#: Run working tests from Python 3.3
|
||||
check-3.3: check-bytecode
|
||||
$(PYTHON) test_pythonlib.py --bytecode-3.3-run --verify-run
|
||||
$(PYTHON) test_pythonlib.py --bytecode-3.3 --syntax-verify $(COMPILE)
|
||||
$(PYTHON) test_pythonlib.py --bytecode-3.3-run
|
||||
|
||||
#: Run working tests from Python 3.4
|
||||
check-3.4: check-bytecode check-3.4-ok check-2.7-ok
|
||||
$(PYTHON) test_pythonlib.py --bytecode-3.4-run --verify-run
|
||||
$(PYTHON) test_pythonlib.py --bytecode-3.4 --syntax-verify $(COMPILE)
|
||||
$(PYTHON) test_pythonlib.py --bytecode-3.4-run
|
||||
|
||||
#: Run working tests from Python 3.5
|
||||
check-3.5: check-bytecode
|
||||
$(PYTHON) test_pythonlib.py --bytecode-3.5-run --verify-run
|
||||
$(PYTHON) test_pythonlib.py --bytecode-3.5 --syntax-verify $(COMPILE)
|
||||
$(PYTHON) test_pythonlib.py --bytecode-3.5-run
|
||||
|
||||
#: Run working tests from Python 3.6
|
||||
check-3.6: check-bytecode
|
||||
$(PYTHON) test_pythonlib.py --bytecode-3.6-run --verify-run
|
||||
$(PYTHON) test_pythonlib.py --bytecode-3.6 --syntax-verify $(COMPILE)
|
||||
$(PYTHON) test_pythonlib.py --bytecode-3.6-run
|
||||
|
||||
#: Run working tests from Python 3.7
|
||||
check-3.7: check-bytecode
|
||||
$(PYTHON) test_pythonlib.py --bytecode-3.7-run --verify-run
|
||||
$(PYTHON) test_pythonlib.py --bytecode-3.7 --syntax-verify $(COMPILE)
|
||||
$(PYTHON) test_pythonlib.py --bytecode-3.7-run
|
||||
|
||||
# #: Run working tests from Python 3.8
|
||||
# check-3.8: check-bytecode
|
||||
# $(PYTHON) test_pythonlib.py --bytecode-3.8-run --verify-run
|
||||
# $(PYTHON) test_pythonlib.py --bytecode-3.8 --syntax-verify $(COMPILE)
|
||||
check-pypy37: check-bytecode
|
||||
$(PYTHON) test_pythonlib.py --bytecode-pypy37 --verify-run
|
||||
|
||||
#: Run working tests from Python 3.8
|
||||
check-3.8: check-bytecode
|
||||
$(PYTHON) test_pythonlib.py --bytecode-3.8-run --verify-run
|
||||
$(PYTHON) test_pythonlib.py --bytecode-3.8 --syntax-verify $(COMPILE)
|
||||
$(PYTHON) test_pythonlib.py --bytecode-pypy37
|
||||
|
||||
check-3.9: check-bytecode
|
||||
@echo "Note that we do not support decompiling Python 3.9 bytecode - no 3.9 tests run"
|
||||
@@ -274,54 +265,58 @@ grammar-coverage-3.7:
|
||||
|
||||
#: Check deparsing Python 3.0
|
||||
check-bytecode-3.0:
|
||||
$(PYTHON) test_pythonlib.py --bytecode-3.0-run --verify-run
|
||||
$(PYTHON) test_pythonlib.py --bytecode-3.0 --syntax-verify
|
||||
$(PYTHON) test_pythonlib.py --bytecode-3.0-run
|
||||
$(PYTHON) test_pythonlib.py --bytecode-3.0
|
||||
|
||||
#: Check deparsing Python 3.1
|
||||
check-bytecode-3.1:
|
||||
$(PYTHON) test_pythonlib.py --bytecode-3.1-run --verify-run
|
||||
$(PYTHON) test_pythonlib.py --bytecode-3.1 --syntax-verify
|
||||
$(PYTHON) test_pythonlib.py --bytecode-3.1-run
|
||||
$(PYTHON) test_pythonlib.py --bytecode-3.1
|
||||
|
||||
#: Check deparsing Python 3.2
|
||||
check-bytecode-3.2:
|
||||
$(PYTHON) test_pythonlib.py --bytecode-3.2-run --verify-run
|
||||
$(PYTHON) test_pythonlib.py --bytecode-3.2 --syntax-verify
|
||||
$(PYTHON) test_pythonlib.py --bytecode-3.2-run
|
||||
$(PYTHON) test_pythonlib.py --bytecode-3.2
|
||||
|
||||
#: Check deparsing Python 3.3
|
||||
check-bytecode-3.3:
|
||||
$(PYTHON) test_pythonlib.py --bytecode-3.3-run --verify-run
|
||||
$(PYTHON) test_pythonlib.py --bytecode-3.3 --syntax-verify
|
||||
$(PYTHON) test_pythonlib.py --bytecode-3.3-run
|
||||
$(PYTHON) test_pythonlib.py --bytecode-3.3
|
||||
|
||||
#: Check deparsing Python 3.4
|
||||
check-bytecode-3.4:
|
||||
$(PYTHON) test_pythonlib.py --bytecode-3.4-run --verify-run
|
||||
$(PYTHON) test_pythonlib.py --bytecode-3.4 --syntax-verify
|
||||
$(PYTHON) test_pythonlib.py --bytecode-3.4-run
|
||||
$(PYTHON) test_pythonlib.py --bytecode-3.4
|
||||
|
||||
#: Check deparsing Python 3.5
|
||||
check-bytecode-3.5:
|
||||
$(PYTHON) test_pythonlib.py --bytecode-3.5-run --verify-run
|
||||
$(PYTHON) test_pythonlib.py --bytecode-3.5 --syntax-verify
|
||||
$(PYTHON) test_pythonlib.py --bytecode-3.5-run
|
||||
$(PYTHON) test_pythonlib.py --bytecode-3.5
|
||||
|
||||
#: Check deparsing Python 3.6
|
||||
check-bytecode-3.6:
|
||||
$(PYTHON) test_pythonlib.py --bytecode-3.6-run --verify-run
|
||||
$(PYTHON) test_pythonlib.py --bytecode-3.6 --syntax-verify
|
||||
$(PYTHON) test_pythonlib.py --bytecode-3.6-run
|
||||
$(PYTHON) test_pythonlib.py --bytecode-3.6
|
||||
|
||||
#: Check deparsing Python 3.7
|
||||
check-bytecode-3.7:
|
||||
$(PYTHON) test_pythonlib.py --bytecode-3.7-run --verify-run
|
||||
$(PYTHON) test_pythonlib.py --bytecode-3.7 --syntax-verify
|
||||
$(PYTHON) test_pythonlib.py --bytecode-3.7-run
|
||||
$(PYTHON) test_pythonlib.py --bytecode-3.7
|
||||
|
||||
#: Check deparsing Python 3.8
|
||||
check-bytecode-3.8:
|
||||
$(PYTHON) test_pythonlib.py --bytecode-3.8-run --verify-run
|
||||
$(PYTHON) test_pythonlib.py --bytecode-3.8 --syntax-verify
|
||||
$(PYTHON) test_pythonlib.py --bytecode-3.8-run
|
||||
$(PYTHON) test_pythonlib.py --bytecode-3.8
|
||||
|
||||
#: short tests for bytecodes only for this version of Python
|
||||
check-native-short:
|
||||
$(PYTHON) test_pythonlib.py --bytecode-$(PYTHON_VERSION) --syntax-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
|
||||
check-2.4-ok:
|
||||
$(PYTHON) test_pythonlib.py --ok-2.4 --verify $(COMPILE)
|
||||
|
||||
#: Run longer Python 2.6's lib files known to be okay
|
||||
check-2.6-ok:
|
||||
$(PYTHON) test_pythonlib.py --ok-2.6 --syntax-verify $(COMPILE)
|
||||
|
Binary file not shown.
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.
BIN
test/bytecode_2.4/01_ops.pyc
Normal file
BIN
test/bytecode_2.4/01_ops.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.
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.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
test/bytecode_2.4_run/01_lambda_call.pyc
Normal file
BIN
test/bytecode_2.4_run/01_lambda_call.pyc
Normal file
Binary file not shown.
BIN
test/bytecode_2.4_run/02_slice.pyc
Normal file
BIN
test/bytecode_2.4_run/02_slice.pyc
Normal file
Binary file not shown.
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.
BIN
test/bytecode_2.4_run/10_for.pyc
Normal file
BIN
test/bytecode_2.4_run/10_for.pyc
Normal file
Binary file not shown.
BIN
test/bytecode_2.4_run/10_mixed_boolean.pyc
Normal file
BIN
test/bytecode_2.4_run/10_mixed_boolean.pyc
Normal file
Binary file not shown.
BIN
test/bytecode_2.4_run/15_mixed_expressions.pyc
Normal file
BIN
test/bytecode_2.4_run/15_mixed_expressions.pyc
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
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.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
test/bytecode_2.6_run/02_slice.pyc
Normal file
BIN
test/bytecode_2.6_run/02_slice.pyc
Normal file
Binary file not shown.
BIN
test/bytecode_2.6_run/10_for.pyc
Normal file
BIN
test/bytecode_2.6_run/10_for.pyc
Normal file
Binary file not shown.
BIN
test/bytecode_2.6_run/10_mixed_boolean.pyc
Normal file
BIN
test/bytecode_2.6_run/10_mixed_boolean.pyc
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
test/bytecode_3.0_run/03_comprehension_in_lambda.pyc-notyet
Normal file
BIN
test/bytecode_3.0_run/03_comprehension_in_lambda.pyc-notyet
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -1,17 +1,16 @@
|
||||
#!/usr/bin/env python
|
||||
# Mode: -*- python -*-
|
||||
#
|
||||
# Copyright (c) 2015 by Rocky Bernstein <rb@dustyfeet.com>
|
||||
# Copyright (c) 2015, 2017, 2022 by Rocky Bernstein <rb@dustyfeet.com>
|
||||
#
|
||||
from __future__ import print_function
|
||||
|
||||
|
||||
import dis, os.path
|
||||
from xdis import PYTHON_VERSION_TRIPL< PYTHON_VERSION_STR
|
||||
|
||||
try:
|
||||
if PYTHON_VERSION_TRIPLE < (2, 5):
|
||||
from cStringIO import StringIO
|
||||
else:
|
||||
from StringIO import StringIO
|
||||
except ImportError:
|
||||
from io import StringIO
|
||||
|
||||
program = os.path.basename(__file__)
|
||||
|
||||
@@ -23,7 +22,7 @@ Usage: %s [OPTIONS]... FILE
|
||||
usage_short = "Usage: %s [OPTIONS]... FILE" % program
|
||||
|
||||
import uncompyle6
|
||||
from uncompyle6 import PYTHON_VERSION_STR, check_python_version
|
||||
from uncompyle6 check_python_version
|
||||
from uncompyle6.disas import disco
|
||||
|
||||
def inst_fmt(inst):
|
||||
|
@@ -34,10 +34,9 @@ else
|
||||
fi
|
||||
|
||||
MAIN="test_pyenvlib.py"
|
||||
|
||||
USER=${USER:-rocky}
|
||||
EMAIL=${EMAIL:-rb@dustyfeet.com}
|
||||
WHAT="uncompyle6 ${MAIN}"
|
||||
WHAT="uncompyle6 2.4 ${MAIN}"
|
||||
MAX_TESTS=${MAX_TESTS:-800}
|
||||
export BATCH=1
|
||||
|
||||
@@ -45,7 +44,7 @@ typeset -i RUN_STARTTIME=$(date +%s)
|
||||
|
||||
# PYVERSIONS="3.5.6"
|
||||
MAILBODY=/tmp/${MAIN}-mailbody-$$.txt
|
||||
# for VERSION in 3.3.7 ; do
|
||||
# for VERSION in 2.4.6 2.5.9 ; do
|
||||
for VERSION in $PYVERSIONS ; do
|
||||
typeset -i rc=0
|
||||
LOGFILE=/tmp/${MAIN}-$VERSION-$$.log
|
||||
|
@@ -1,7 +1,6 @@
|
||||
#!/usr/bin/env python
|
||||
|
||||
from __future__ import print_function
|
||||
|
||||
from uncompyle6 import uncompyle
|
||||
from uncompyle6.main import decompile
|
||||
from xdis import sysinfo2float
|
||||
import sys, inspect
|
||||
|
17
test/simple_source/bug14/lambda.py
Normal file
17
test/simple_source/bug14/lambda.py
Normal file
@@ -0,0 +1,17 @@
|
||||
palette = map(lambda a:(a,
|
||||
a,
|
||||
a)
|
||||
, range(256))
|
||||
palette = map(lambda (r, g, b,):((chr(r) + chr(g)) + chr(b))
|
||||
, palette)
|
||||
palette = map(lambda r:r
|
||||
, palette)
|
||||
palette = lambda (r, g, b,):r
|
||||
|
||||
palette = lambda (r):r
|
||||
|
||||
palette = lambda r:r
|
||||
|
||||
palette = (lambda (r):r
|
||||
,
|
||||
palette)
|
7
test/simple_source/bug25/02_yield_bug.py
Normal file
7
test/simple_source/bug25/02_yield_bug.py
Normal file
@@ -0,0 +1,7 @@
|
||||
# From 2.4 test_array.py
|
||||
# In Python 2.4 and earlier "yield" is not valid and instead
|
||||
# we must use "yield None". Bug was not adding "None"
|
||||
|
||||
def yield_bug():
|
||||
yield None
|
||||
return
|
19
test/simple_source/bug25/04_try_else_confuse.py
Normal file
19
test/simple_source/bug25/04_try_else_confuse.py
Normal file
@@ -0,0 +1,19 @@
|
||||
# From 2.4 test_sax.py
|
||||
# Bug was distinguishing try from try/else
|
||||
|
||||
def verify_empty_attrs():
|
||||
gvqk = 3
|
||||
try:
|
||||
gvk = 1/0
|
||||
except ZeroDivisionError:
|
||||
gvk = 1
|
||||
|
||||
try:
|
||||
gvqk = 0
|
||||
except KeyError:
|
||||
gvqk = 1
|
||||
|
||||
# If try/else was used above the return will be 4
|
||||
return gvk + gvqk
|
||||
|
||||
assert 1 == verify_empty_attrs()
|
@@ -5,6 +5,7 @@ SKIP_TESTS=(
|
||||
[test_ftplib.py]=1 # FIXME: Works on c90ff51
|
||||
[test_slice.py]=1 # FIXME: Works on c90ff51
|
||||
[test_sort.py]=1 # FIXME: Works on c90ff51
|
||||
[test_strftime.py]=1 # FIXME: Works on c90ff51
|
||||
[test_timeit.py]=1 # FIXME: Works on c90ff51
|
||||
[test_os.py]=1 # parse error FIXME: Works on c90ff51
|
||||
|
||||
|
151
test/stdlib/runtests-circleci.sh
Executable file
151
test/stdlib/runtests-circleci.sh
Executable file
@@ -0,0 +1,151 @@
|
||||
#!/bin/bash
|
||||
echo "This needs work"
|
||||
exit 0
|
||||
me=${BASH_SOURCE[0]}
|
||||
|
||||
# Note: for 2.6 sometimes we need to set PYTHON=pytest
|
||||
PYTHON=${PYTHON:-python}
|
||||
|
||||
typeset -i BATCH=${BATCH:-0}
|
||||
if (( ! BATCH )) ; then
|
||||
isatty=$(/usr/bin/tty 2>/dev/null)
|
||||
if [[ -n $isatty ]] && [[ "$isatty" != 'not a tty' ]] ; then
|
||||
BATCH=0
|
||||
fi
|
||||
fi
|
||||
|
||||
|
||||
function displaytime {
|
||||
local T=$1
|
||||
local D=$((T/60/60/24))
|
||||
local H=$((T/60/60%24))
|
||||
local M=$((T/60%60))
|
||||
local S=$((T%60))
|
||||
(( D > 0 )) && printf '%d days ' $D
|
||||
(( H > 0 )) && printf '%d hours ' $H
|
||||
(( M > 0 )) && printf '%d minutes ' $M
|
||||
(( D > 0 || H > 0 || M > 0 )) && printf 'and '
|
||||
printf '%d seconds\n' $S
|
||||
}
|
||||
|
||||
FULLVERSION=2.7.18
|
||||
IS_PYPY=0
|
||||
MINOR=${FULLVERSION##?.?.}
|
||||
|
||||
STOP_ONERROR=${STOP_ONERROR:-1}
|
||||
|
||||
typeset -i timeout=15
|
||||
|
||||
function timeout_cmd {
|
||||
|
||||
(
|
||||
$@ &
|
||||
child=$!
|
||||
trap -- "" SIGTERM
|
||||
(
|
||||
sleep "$timeout"
|
||||
if ps -p $child >/dev/null ; then
|
||||
echo ""
|
||||
echo >&1 "**Killing ${2}; takes more than $timeout seconds to run"
|
||||
kill -TERM ${child}
|
||||
fi
|
||||
) &
|
||||
wait "$child"
|
||||
)
|
||||
}
|
||||
|
||||
. ./2.7-exclude.sh
|
||||
|
||||
# Test directory setup
|
||||
srcdir=$(dirname $me)
|
||||
cd $srcdir
|
||||
fulldir=$(pwd)
|
||||
|
||||
# DECOMPILER=uncompyle2
|
||||
DECOMPILER=${DECOMPILER:-"$fulldir/../../bin/uncompyle6"}
|
||||
OPTS=${OPTS:-""}
|
||||
TESTDIR=/tmp/test2.7
|
||||
if [[ -e $TESTDIR ]] ; then
|
||||
rm -fr $TESTDIR
|
||||
fi
|
||||
|
||||
mkdir $TESTDIR || exit $?
|
||||
(cd /usr/local/lib/python2.7/site-packages && cp */test*.pyc $TESTDIR)
|
||||
(cd /usr/local/lib/python2.7/site-packages && cp */*/test*.pyc $TESTDIR)
|
||||
cd $TESTDIR
|
||||
export PATH=/usr/local/bin/python:${PATH}
|
||||
|
||||
DONT_SKIP_TESTS=${DONT_SKIP_TESTS:-0}
|
||||
|
||||
# Run tests
|
||||
typeset -i i=0
|
||||
typeset -i allerrs=0
|
||||
if [[ -n $1 ]] ; then
|
||||
files=$@
|
||||
typeset -a files_ary=( $(echo $@) )
|
||||
if (( ${#files_ary[@]} == 1 || DONT_SKIP_TESTS == 1 )) ; then
|
||||
SKIP_TESTS=()
|
||||
fi
|
||||
elif [[ "$CIRCLECI" == "true" ]] ; then
|
||||
files=$(echo test_*.pyc)
|
||||
else
|
||||
files=$(echo test_*.py)
|
||||
fi
|
||||
|
||||
typeset -i ALL_FILES_STARTTIME=$(date +%s)
|
||||
typeset -i skipped=0
|
||||
|
||||
NOT_INVERTED_TESTS=${NOT_INVERTED_TESTS:-1}
|
||||
|
||||
for file in $files; do
|
||||
# If the fails *before* decompiling, skip it!
|
||||
typeset -i STARTTIME=$(date +%s)
|
||||
if [ ! -r $file ]; then
|
||||
echo "Skipping test $file -- not readable. Does it exist?"
|
||||
continue
|
||||
elif ! $PYTHON $file >/dev/null 2>&1 ; then
|
||||
echo "Skipping test $file -- it fails on its own"
|
||||
continue
|
||||
fi
|
||||
typeset -i ENDTIME=$(date +%s)
|
||||
typeset -i time_diff
|
||||
(( time_diff = ENDTIME - STARTTIME))
|
||||
if (( time_diff > timeout )) ; then
|
||||
echo "Skipping test $file -- test takes too long to run: $time_diff seconds"
|
||||
continue
|
||||
fi
|
||||
|
||||
((i++))
|
||||
# (( i > 40 )) && break
|
||||
short_name=$(basename $file .py)
|
||||
if ((IS_PYPY)); then
|
||||
decompiled_file=$short_name-${MAJOR}.${MINOR}.pyc
|
||||
else
|
||||
decompiled_file=$short_name-${PYVERSION}.pyc
|
||||
fi
|
||||
$fulldir/compile-file.py $file && \
|
||||
mv $file{,.orig} && \
|
||||
echo ========== $(date +%X) Decompiling $file ===========
|
||||
$DECOMPILER $OPTS $decompiled_file > $file 2>/dev/null
|
||||
rc=$?
|
||||
if (( rc == 0 )) ; then
|
||||
echo ========== $(date +%X) Running $file ===========
|
||||
timeout_cmd $PYTHON $file
|
||||
rc=$?
|
||||
else
|
||||
echo ======= Skipping $file due to compile/decompile errors ========
|
||||
fi
|
||||
(( rc != 0 && allerrs++ ))
|
||||
if (( STOP_ONERROR && rc )) ; then
|
||||
echo "** Ran $i tests before failure. Skipped $skipped test for known failures. **"
|
||||
exit $allerrs
|
||||
fi
|
||||
done
|
||||
typeset -i ALL_FILES_ENDTIME=$(date +%s)
|
||||
|
||||
(( time_diff = ALL_FILES_ENDTIME - ALL_FILES_STARTTIME))
|
||||
|
||||
printf "Ran $i unit-test files, $allerrs errors; Elapsed time: "
|
||||
displaytime $time_diff
|
||||
echo "Skipped $skipped test for known failures."
|
||||
exit $allerrs
|
@@ -19,15 +19,19 @@ function displaytime {
|
||||
local H=$((T/60/60%24))
|
||||
local M=$((T/60%60))
|
||||
local S=$((T%60))
|
||||
(( $D > 0 )) && printf '%d days ' $D
|
||||
(( $H > 0 )) && printf '%d hours ' $H
|
||||
(( $M > 0 )) && printf '%d minutes ' $M
|
||||
(( $D > 0 || $H > 0 || $M > 0 )) && printf 'and '
|
||||
(( D > 0 )) && printf '%d days ' $D
|
||||
(( H > 0 )) && printf '%d hours ' $H
|
||||
(( M > 0 )) && printf '%d minutes ' $M
|
||||
(( D > 0 || H > 0 || M > 0 )) && printf 'and '
|
||||
printf '%d seconds\n' $S
|
||||
}
|
||||
|
||||
# Python version setup
|
||||
FULLVERSION=$(pyenv local)
|
||||
if [[ "$CIRCLECI" == "true" ]]; then
|
||||
FULLVERSION=$(pyenv local)
|
||||
else
|
||||
FULLVERSION=$(pyenv local)
|
||||
fi
|
||||
PYVERSION=${FULLVERSION%.*}
|
||||
|
||||
if [[ $PYVERSION =~ 'pypy' ]] ; then
|
||||
@@ -225,7 +229,7 @@ for file in $files; do
|
||||
typeset -i ENDTIME=$(date +%s)
|
||||
typeset -i time_diff
|
||||
(( time_diff = ENDTIME - STARTTIME))
|
||||
if (( time_diff > $timeout )) ; then
|
||||
if (( time_diff > timeout )) ; then
|
||||
echo "Skipping test $file -- test takes too long to run: $time_diff seconds"
|
||||
continue
|
||||
fi
|
||||
@@ -241,7 +245,7 @@ for file in $files; do
|
||||
$fulldir/compile-file.py $file && \
|
||||
mv $file{,.orig} && \
|
||||
echo ========== $(date +%X) Decompiling $file ===========
|
||||
$DECOMPILER $OPTS $decompiled_file > $file
|
||||
$DECOMPILER $OPTS $decompiled_file > $file 2>/dev/null
|
||||
rc=$?
|
||||
if (( rc == 0 )) ; then
|
||||
echo ========== $(date +%X) Running $file ===========
|
||||
|
11
test/test-xpython.sh
Executable file
11
test/test-xpython.sh
Executable file
@@ -0,0 +1,11 @@
|
||||
#!/bin/bash
|
||||
# Checks xpython passes all runnable bytecode here
|
||||
|
||||
for dir in bytecode_*_run; do
|
||||
for file in ${dir}/*.pyc; do
|
||||
echo $file
|
||||
if ! xpython $file; then
|
||||
break
|
||||
fi
|
||||
done
|
||||
done
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user