Compare commits

..

197 Commits

Author SHA1 Message Date
rocky
ab5303f504 Administrivia 2018-04-16 13:06:16 -04:00
rocky
6c6d62edb8 python 2.6 grammar test tweak 2018-04-16 13:00:30 -04:00
rocky
245deb0931 Get ready for release 3.8.1 ...
and more 3.7 grammar customization
2018-04-16 12:53:35 -04:00
rocky
87b70cfd13 Plough forward on 3.7 CALL_FUNCTION_EX 2018-04-15 14:15:25 -04:00
rocky
bbc7616e24 More wordsmithing 2018-04-15 14:05:38 -04:00
rocky
d5b7be59c5 Wordsmithing 2018-04-15 13:18:06 -04:00
rocky
7a4c11c3f4 testing administrivia 2018-04-15 05:57:25 -04:00
rocky
9ef38285f4 Fix bug in fragment parser 2018-04-14 06:54:15 -04:00
rocky
5de8a33286 codeNode->code_node 2018-04-13 15:44:41 -04:00
rocky
9e652f3fc6 More 3.7 grammar rules...
largely adapted from 3.6
2018-04-13 14:24:20 -04:00
rocky
9fa7b9ea53 Forge on with 3.7 2018-04-13 13:31:47 -04:00
rocky
1890aad660 Small 3.7 steps 2018-04-13 07:26:32 -04:00
rocky
7237658f1f Start to handle 3.7 2018-04-12 23:49:37 -04:00
rocky
fa6408d53b Testing with other decompiler tools 2018-04-12 19:57:53 -04:00
rocky
da57e2d416 Note verification process and results 2018-04-12 18:56:57 -04:00
rocky
9545541be7 Isolate Python 3 class code from Python2 2018-04-12 18:10:32 -04:00
rocky
98f969592c Merge branch 'master' of github.com:rocky/python-uncompyle6 2018-04-12 18:00:50 -04:00
rocky
edbab038ca Fix improper 3.0 class handling...
... is like 3.1 not 2.7
2018-04-12 17:59:39 -04:00
rocky
08cbf56eea Batch testing adjustment 2018-04-12 11:20:27 -04:00
rocky
8734608929 Small doc typos 2018-04-09 01:36:42 -04:00
rocky
ab414d3d9c Get ready for release 3.1.2 2018-04-08 05:34:25 -04:00
rocky
ede6eabc40 Slightly Python 3.x handing of subclasses...
which are created via a call to create a subclass.

Should be more general though.
2018-04-08 05:22:35 -04:00
rocky
61e2b3b635 Can run on 3.1. Fix some 3.1 function-call bugs 2018-04-08 04:11:01 -04:00
rocky
23fb07b1c9 Update test 2018-04-07 07:21:22 -04:00
rocky
1bbb72a6ce Handle class with one kwarg subclass 2018-04-07 07:13:49 -04:00
rocky
17361a9baa Administrivia 2018-04-06 22:11:30 -04:00
rocky
68821efdb0 Improve 3.5+ BUILD_MAP_UNPACK...
And add build_tuple_unpack runtime test from a previous commit.

We are far from out of the woods, as there is more to do and
we've uncovered more bugs in handling this.
2018-04-06 21:34:31 -04:00
rocky
e9ee671874 Testing administriva 2018-04-06 19:06:11 -04:00
rocky
9593043432 Add more stdlib run test coverage 2018-04-06 14:23:56 -04:00
rocky
1c95eb7b4e Make sure we call 'expr' go set precidence right 2018-04-06 14:04:58 -04:00
rocky
ff9ae4e792 Better handling of BUILD_TUPLE_UNPACK 2018-04-06 11:35:41 -04:00
rocky
d9eb5c5b09 Start folding in 3.5 vararg ops as varargs ops 2018-04-05 23:02:45 -04:00
rocky
e7b7de8842 Bump xdis version 2018-04-04 23:55:01 -04:00
rocky
3f26589bf1 More testing 2018-04-04 22:43:19 -04:00
rocky
30ce3a8bea Small tweaks 2018-04-04 22:36:26 -04:00
rocky
341e17f62c Split of Python 3 semantic-action customization...
And remove duplicate customization code in pysource.
2018-04-04 21:54:09 -04:00
rocky
b561b0090c Increase testing 2018-04-04 20:32:54 -04:00
rocky
ca41ea99f2 Fix 3.2 to 3.3 make_function more properly 2018-04-04 14:30:34 -04:00
rocky
e3040c78a9 3.2-3.4 Functions cals/defininitions yet again
And we're still not out of the woods.
2018-04-03 21:27:31 -04:00
rocky
a556e96c22 Merge branch 'master' of github.com:rocky/python-uncompyle6 2018-04-03 19:44:09 -04:00
rocky
e9c0d03b8b 3.2 mk_func tweak...
...more is needed though
2018-04-03 17:57:37 -04:00
rocky
155fd06372 More administrivia 2018-04-03 11:08:22 -04:00
rocky
acff1b6ee0 Administrivia
Adjust requirements-dev for 2.6.9
2018-04-03 11:00:16 -04:00
rocky
1cd2d1e915 DRY scanner code more...
Expand 2.6 testing
2018-04-03 10:35:02 -04:00
rocky
e2dec73a62 3.5 CALL_FUNCTION_VAR bug 2018-04-03 05:56:45 -04:00
rocky
fad43feb3d DRY instruction building code...
There is a little more that could be done with  self.offset2inst_index
2018-04-03 04:41:36 -04:00
rocky
96d8daeae9 More pyenv testing 2018-04-01 21:19:55 -04:00
rocky
8f6a1cb10b Add 3.2 to list of supported distributions 2018-04-01 16:54:10 -04:00
rocky
fc98bc972e Update NEWS 2018-04-01 14:53:45 -04:00
rocky
007ba4a8f3 Get ready for release 3.1.1 2018-04-01 14:17:50 -04:00
rocky
6b78677a74 Work on 3.5+ BUILD_MAP_UNPACK...
bugs still remain, just reduced.
2018-04-01 13:41:16 -04:00
rocky
ab1dba1536 Handle 3.5+ BUILD_MAP_UNPACK used in dictionaries
A number of weaknesses have been uncovered though
2018-04-01 12:56:58 -04:00
rocky
254d0519bb More 3.6 CALL_FUNCTION argument parsing 2018-04-01 11:26:46 -04:00
rocky
120412f5a8 Add Python 3.6 setcomp and another call bug 2018-04-01 07:09:24 -04:00
rocky
b54be24e14 3.6 argument parsing 2018-03-31 23:07:06 -04:00
rocky
535df1592e Another 3.6 control-flow bug...
and add source to some previous bytecode tests
2018-03-31 19:28:35 -04:00
rocky
64ffa5f6ab Add semantic action rule for except_return 2018-03-29 22:50:25 -04:00
rocky
9be4908c9c Python 3.6 MAKE_FUNCTION yet again...
And we'll eventually have to do more down the line
2018-03-29 22:04:46 -04:00
rocky
f18ce71e91 Replace all_instrs with inst_matches...
which works on 3.6+. Still should write a pytest for this.
2018-03-29 21:23:26 -04:00
rocky
362a353e03 Merge branch 'master' of github.com:rocky/python-uncompyle6 2018-03-29 17:21:51 -04:00
rocky
7d110f17bc 3.6 decompilation problems 2018-03-29 17:21:22 -04:00
R. Bernstein
04f4f3c25f Merge pull request #166 from rocky/grammer-reduce
Some 3.x grammar reduction...
2018-03-29 11:59:37 -04:00
rocky
1d5f4b0a05 Some 3.x grammar reduction...
Add 3.2 to grammar testing
2018-03-28 21:19:27 -04:00
rocky
dc3e6b31ca Limit coverage on 3.6 for now 2018-03-28 13:47:30 -04:00
rocky
94a81a36b7 3.5, 3.6 loop if/continue handling 2018-03-28 09:23:34 -04:00
rocky
e568d68baa Reinstate a test 2018-03-28 07:52:04 -04:00
R. Bernstein
8c22d57979 Merge pull request #165 from rocky/grammar-cleanup2
Grammar reduction for 2.6/2.7,3.x
2018-03-27 20:11:29 -04:00
rocky
bf0f5715a3 Adjust grammar-checking test 2018-03-27 19:47:08 -04:00
rocky
d90c44b454 3.5+ handle then before "if" jump going to loop 2018-03-27 19:24:29 -04:00
rocky
9d807501af Grammar reduction for 2.6/2.7,3.x 2018-03-27 17:02:03 -04:00
rocky
aa4416571b grammar-cover run-and-email fixup 2018-03-27 14:21:28 -04:00
rocky
d38395334c grammar-cover administrivia 2018-03-27 04:33:01 -04:00
rocky
516c7a0e9a Python 3.6 CALL_FUNCTION_EX fixes 2018-03-27 04:10:11 -04:00
rocky
681588f12d 3.5 CALL_FUNCTION_EX 2018-03-26 20:56:17 -04:00
rocky
3500c49daf More Python 3.4 CALL_FUNCTION_VAR 2018-03-26 19:40:33 -04:00
rocky
3d218c84b0 LOAD assert needs to be on 3.x...
Expand testing
2018-03-26 18:11:57 -04:00
rocky
1afe1fd943 Merge branch 'master' of github.com:rocky/python-uncompyle6 2018-03-26 14:50:54 -04:00
rocky
c5f8bbf32d Remove hacky 3.x offset address arithmetic 2018-03-26 14:50:17 -04:00
rocky
6b36d14859 Limit grammar coverage of 3.5.5 for now 2018-03-26 13:33:22 -04:00
rocky
ccbe8a8e2b cover all of 2.6.9 2018-03-26 12:55:43 -04:00
rocky
46c02bd352 There is no 2.8 2018-03-26 12:38:48 -04:00
rocky
30ba043000 Grammar coverage hacking 2018-03-26 11:12:56 -04:00
rocky
1f0e5f27d5 DRY grammar code 2018-03-26 11:08:27 -04:00
rocky
75245ba38c Back off full 2.7.14 testing for now 2018-03-26 09:47:18 -04:00
rocky
4889916304 Grammar coverage work 2018-03-26 09:26:24 -04:00
rocky
d1806edaad Administrivia: grammar coverage 2018-03-26 09:23:24 -04:00
rocky
c968e31be8 Administrivia: grammar coverage 2018-03-26 09:16:15 -04:00
rocky
c8870c6ed8 Grammar coverage hacking 2018-03-26 08:41:40 -04:00
rocky
23180806b4 More grammar coverage hacking 2018-03-26 08:19:03 -04:00
rocky
1f835d6237 Start grammar coverage testing 2018-03-26 08:03:54 -04:00
rocky
3d072e29a6 3.5 CALL_FUNCTION_VAR runnable test 2018-03-26 07:45:34 -04:00
rocky
74f01fbe33 Python 3.5 CALL_FUNCTION_VAR handling 2018-03-26 07:42:15 -04:00
rocky
710c950965 Bang on 3.4 CALL_FUNCTION_VAR 2018-03-26 00:19:39 -04:00
rocky
7aa6ff1d9b 3.6.4 runtests.sh futzing 2018-03-25 22:48:33 -04:00
rocky
421c358f9d Put 3.5.5 back into testing 2018-03-25 22:30:36 -04:00
rocky
cfb4ad625f 3.5 *() arg without further args 2018-03-25 22:24:32 -04:00
R. Bernstein
0b622a0ad8 Merge pull request #163 from rocky/grammar-cleanup
Grammar cleanup
2018-03-25 21:30:50 -04:00
rocky
8b7d5d3270 Merge branch 'master' into grammar-cleanup 2018-03-25 20:57:51 -04:00
rocky
5c7fdf6e8f Adjust stdlib tests 2018-03-25 20:55:04 -04:00
rocky
d2c8e4e12c Adjust test_grammar for recent changes 2018-03-25 20:52:28 -04:00
rocky
626f690a5a More grammar specialization by instruction 2018-03-25 20:38:21 -04:00
rocky
39cef6a41b More raise vs. assert hacky distinctions 2018-03-25 17:56:35 -04:00
rocky
116fbb33e0 Merge branch 'master' of github.com:rocky/python-uncompyle6 2018-03-25 17:36:46 -04:00
rocky
631940887f Additional Python 2.x assert vs raise testing 2018-03-25 17:35:18 -04:00
rocky
47beff57b2 Increase testing 2018-03-25 14:56:48 -04:00
rocky
7fb94176b1 Less ambigouus 2.x grammar rule for BUILD_MAP 2018-03-25 12:09:42 -04:00
rocky
2ae9cd7d08 bang on CALL_FUNCTION_EX_KW 2018-03-24 10:52:55 -04:00
rocky
1f663013ab 3.5 CALL_FUNCTION_VAR semantic handling 2018-03-24 10:24:16 -04:00
rocky
e3c7afb94d Towards handling 3.x' CALL_FUNCTION_VAR correctly 2018-03-24 08:26:45 -04:00
rocky
0d327ab0ce Fix bug introduced in last commit 2018-03-24 06:29:35 -04:00
rocky
35a60e0274 Fix parser slowness in decompiling 3.x locale.py..
And remove grammar inefficiency in adding extraneous kwargs in <= 3.2
kwargs was nullable so it might not have been wasn't wrong, just inefficient.
2018-03-23 11:59:04 -04:00
rocky
1b2b45642b 3.6 try except-as bug 2018-03-22 23:54:12 -04:00
rocky
28bfb453f5 Localize call_kw precedence to 3.6 2018-03-22 14:21:36 -04:00
rocky
df55ce3212 Isolate some 3.x dictcomp grammar rules 2018-03-22 13:34:39 -04:00
rocky
fcb4409e50 Omit 2.7 test_generators.py 2018-03-21 21:01:01 -04:00
rocky
155031a7c4 Get ready for release 3.1.0 2018-03-21 20:11:06 -04:00
rocky
c81b40b43b Comment out test/demo code 2018-03-21 20:00:25 -04:00
rocky
7fc7e083c3 A couple of 3.6 bugs...
remove parens around decorators by adjusting precidence
Partial handling of quotes within 3.6 format strings
2018-03-21 19:54:28 -04:00
rocky
d41a858f80 Messed up API compatibility 2018-03-21 17:38:38 -04:00
rocky
6dd0ad0810 Merge branch 'master' of github.com:rocky/python-uncompyle6 2018-03-21 17:01:21 -04:00
rocky
9368b63a2f Add 3.5 and 3.6 exclusions for runtests.sh...
All 3.x unit-test-type tests can be run via runtests.sh
2018-03-21 17:00:40 -04:00
rocky
da06d83a87 3.6 subclass extraction bug 2018-03-21 15:14:23 -04:00
rocky
6fb5808ff0 Merge branch 'master' of github.com:rocky/python-uncompyle6 2018-03-21 13:18:50 -04:00
rocky
0c3db340fa 2.7 bug confusing "or" with "if" and "assert" 2018-03-21 13:18:18 -04:00
rocky
925b6667d7 3.6 CALL_FUNCTION_KW handling 2018-03-21 08:01:45 -04:00
rocky
b8547346b7 Back off write "mode" setting to < 3.0 2018-03-21 00:25:41 -04:00
rocky
0aa7a7c223 Python code output should be binary...
as it may contain weird characters in strings. in 3.6 or so

r
2018-03-21 00:17:42 -04:00
rocky
cf5445c202 Test administrivia 2018-03-20 21:59:50 -04:00
rocky
bc8c38ee58 Another 2.7 runtests.sh ignore. 2018-03-20 21:01:05 -04:00
rocky
4cd81dab61 ignore 2.6.9 test in runtests.sh
It seems to fail intermittently
2018-03-20 19:29:47 -04:00
rocky
4f4b628842 Merge branch 'master' of github.com:rocky/python-uncompyle6 2018-03-20 16:15:28 -04:00
rocky
ff50a7f37b In 2.7: raise <expr>; expr can't be a "or" 2018-03-20 16:14:53 -04:00
rocky
85a49aec2f Work on fragments API...
* Add code_deparse_around_offset
* find_globals -> find_globals_and_nonlocals
2018-03-20 13:43:16 -04:00
rocky
9f2c7352e7 Administrivia: run-and-email.sh tweaks 2018-03-20 12:34:48 -04:00
rocky
e9cf370e11 Administrivia:
Adjust Travis 2.7 environment
Batch testing of all 3.4.8 pyenv files
2018-03-20 11:44:46 -04:00
rocky
90ac8a463d Adjust 3.x while1else reduction check 2018-03-20 11:33:10 -04:00
rocky
0e64111195 Extend 3.4: "while 1: if : continue" handling 2018-03-20 10:37:19 -04:00
rocky
fd84325e4f Fix status on failed runtests 2018-03-20 07:26:42 -04:00
rocky
ddc00edd42 Correct max on email subject header 2018-03-20 07:17:07 -04:00
rocky
4259963859 Increase batch testing for 3.4.8 2018-03-20 05:30:07 -04:00
rocky
4905cc6bb0 Note where 3.4's 05 test came from 2018-03-20 05:14:28 -04:00
rocky
f008b8f411 Two 3.4 fixes..
* LOAD_DEREF does not signal "nonlocal" variables
* Add rule for "if" with a "continue" and "return"
2018-03-20 05:07:19 -04:00
rocky
2e81ee5d2e Add 3.5.5 pyenv testing 2018-03-19 22:04:54 -04:00
rocky
50e59a37c1 Python 2 "for" grammar rule isolation 2018-03-19 16:15:53 -04:00
rocky
5c8f93b735 Fix 3.6 try/except with return 2018-03-19 16:12:44 -04:00
rocky
88ef4baca8 Fix a 3.6 try/except-as bug 2018-03-19 11:10:37 -04:00
rocky
6ab711baab More 3.6 lambda handling 2018-03-19 09:36:02 -04:00
rocky
9e05750537 Another 3.6 lambda parsing bug 2018-03-19 09:09:59 -04:00
rocky
5c662b334e Handle 3.x "nonlocal" statement 2018-03-19 07:57:25 -04:00
rocky
56b2e17e30 Adjust 3.6 "while" loop grammar 2018-03-19 06:01:39 -04:00
rocky
94038151f4 Add Python 3.6 mklambda rule 2018-03-18 23:37:32 -04:00
rocky
b9281c79be Fix 3.6 list if "and" comprehension bug 2018-03-18 19:12:16 -04:00
rocky
51dec051df Slightly better assert detection 2018-03-08 08:31:50 -05:00
rocky
f5ac06013f We don't do python 3.1 or 3.2 2018-03-08 02:34:05 -05:00
rocky
06bbacef45 And another 2018-03-07 13:27:20 -05:00
rocky
bfdc6529a0 One more 2018-03-07 13:24:57 -05:00
rocky
1ed389ce61 More run-and-email tweaks 2018-03-07 13:22:33 -05:00
rocky
19f2e1277b Another run-and-email shell tweak 2018-03-07 13:06:27 -05:00
rocky
6290311143 Test administrivia 2018-03-07 11:46:14 -05:00
rocky
947d619c77 Tweak summary message 2018-03-07 11:07:56 -05:00
rocky
908d313204 More test shell tweaking 2018-03-07 08:12:34 -05:00
rocky
38dffa3290 Allow setting max tests via MAX_TESTS env var 2018-03-07 08:00:36 -05:00
rocky
c8747cc899 Only run if pyenv works 2018-03-07 07:53:19 -05:00
rocky
8a705a70f5 Set pyenv version in test 2018-03-07 07:48:45 -05:00
rocky
92d562e600 Need additional try vs try/else checks 2018-03-07 07:38:13 -05:00
rocky
30756c52b2 Add another batch test 2018-03-07 07:24:07 -05:00
rocky
74e280171b Get ready for release 3.0.1 2018-03-07 07:16:40 -05:00
rocky
df0207eb90 For batch testing 2018-03-07 06:12:24 -05:00
rocky
07a8ae9541 Go over 2.6.9 runtests.sh 2018-03-06 23:55:06 -05:00
rocky
5d6872bcd1 test_pyenvlib.py return number of failed now 2018-03-06 19:13:03 -05:00
rocky
c03cdf1a49 Last 2.6 while1 bug...
before all of 2.6.9 stdlib parses without error.
2018-03-06 18:52:27 -05:00
rocky
01ad91b519 Another 2.6 try parse bug 2018-03-06 18:19:01 -05:00
rocky
ccd42077c1 Better 2.6 tryifelse detection 2018-03-06 17:23:08 -05:00
rocky
ca3f822c81 More 2.6 while-loop control flow parsing 2018-03-06 13:16:22 -05:00
rocky
1896c40202 Type comp_ifnot -> comp_if_not...
By the way, the sense of comp_if and list_if is reversed.
Will fix later...
2018-03-06 09:53:55 -05:00
rocky
8278c72a6f Python 2.6 while1 if/and handling 2018-03-06 09:39:13 -05:00
rocky
3b0a5aab16 2.6- CONTINUE/JUMP_BACK confusion workaroud 2018-03-06 00:29:34 -05:00
rocky
a74890d388 Administrivia...
- Add script to run test_pyenvlib.py on everything
- Bump 3.6 version 3.6.4
2018-03-05 23:27:11 -05:00
rocky
5d24367ef6 Small changes...
pysource.py: Bug fix for relative imports.

scanner2.py: Remove a debug expression
2018-03-05 21:53:49 -05:00
rocky
cad1325a90 Python 2.2 code anomoly?
Python 2.2 may generate PRINT_ITEM_CONT in some places for PRINT_ITEM
2018-03-05 12:25:31 -05:00
rocky
61534ceed5 Need to back off set_comp change a little...
There was set_comp already. So what had been setcomp_func is now
merely set_comp_func rather than set_comp. Small improvement but
in the right direction, still
2018-03-05 11:41:21 -05:00
rocky
9f66694056 dictcomp_func -> dict_comp_func...
to match AST better. Also adds a correction in last commit,
including set_comp -> set_comp_expr where apprpriate

Note: can't use dict_comp as that was already used.
But dict_comp_func is matches AST better than dictcomp_func
2018-03-05 11:12:15 -05:00
rocky
2bdfd76635 setcomp_func -> set_comp ...
to match AST name more closely
2018-03-05 10:20:14 -05:00
rocky
01f2f6578b Dictcomp with if for 2.7...
extend grammar in last commit to 2.7 which also has dictionary comprehensions
2018-03-05 08:37:09 -05:00
rocky
02b1554da3 grammar and semantics for dict comp with "if"
Fixes #162
2018-03-05 07:52:02 -05:00
rocky
fac5d31f34 Adjust that 2.2-2.6 "while" may not have COME_FROM 2018-03-05 00:21:54 -05:00
rocky
d42858cae4 additional while1 grammar rules for 2.3-2.6 2018-03-05 00:03:33 -05:00
rocky
9e815d8d79 2.6 and before COME_FROM handling...
also, add in some of the test bytecode from the python-2.4 branch
2018-03-04 21:42:59 -05:00
rocky
def9e1676b look for "closure" node from the end...
Fix previous commit. Looking from the beginning fails because there are
a variable number of default values. From the end though seems fixed.
2018-03-04 19:28:51 -05:00
rocky
35fcb1edf1 Picking out 3.3 function default values 2018-03-04 18:40:08 -05:00
rocky
ffbce9cb77 3.6 class signature problems...
This time getting the class name in when a "load_closure" is added.
2018-03-04 17:25:42 -05:00
rocky
dc1971f559 Prevent 3.6 call_kw deriving itself..
Was causing some calls to be parsed incorrectly
2018-03-04 16:30:22 -05:00
rocky
cef61904c7 Tweak HOW-TO-REPORT... 2018-03-04 09:49:22 -05:00
rocky
778f92b6f4 Fix a 3.6 CALL_FUNCTION_EX_KW problem..
and remove 3.6 customization from pysource.
2018-03-04 09:18:57 -05:00
rocky
a8260edded 3.6 function/class prototype fixes..
Had got the order backwards in: class Foo(a=B.c)
String defaults in default parameter tuples need to be quoted
2018-03-03 09:12:02 -05:00
rocky
c662cb1df2 Bump python versions 2018-03-03 07:36:56 -05:00
rocky
e809ade6e1 Licence is GPL3 2018-03-02 11:13:00 -05:00
188 changed files with 3108 additions and 1937 deletions

12
.gitignore vendored
View File

@@ -1,11 +1,15 @@
*.pyo
*.pyc
*.pyo
*_dis
*~
/.cache
/.eggs
/.hypothesis
/.idea
/.pytest_cache
/.python-version
/.tox
/.venv*
/README
/__pkginfo__.pyc
/dist
@@ -14,9 +18,7 @@
/tmp
/uncompyle6.egg-info
/unpyc
ChangeLog
__pycache__
build
/.venv*
/.idea
/.hypothesis
ChangeLog
nohup.out

View File

@@ -4,7 +4,7 @@ sudo: false
python:
- '3.5'
- '2.7.12'
- '2.7'
- '2.6'
- '3.3'
- '3.4'

View File

@@ -57,6 +57,19 @@ disassembler called `pydisasm`.
### 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
improvement that can't be undone. In earlier versions of Python it is
rare; in later Python versions, it is more common.
@@ -66,7 +79,7 @@ If the code emitted is semantically equivalent, then this isn't a bug.
For example the code might be
```
```python
if a:
if b:
x = 1
@@ -74,7 +87,7 @@ if a:
and we might produce:
```
```python
if a and b:
x = 1
```
@@ -87,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
you write to be more efficient. For example, for:
```
```python
if True:
x = 5
```
Python will generate code like:
```
```python
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
necessarily mean there's a bug.

View File

@@ -27,21 +27,18 @@ check:
check-short: pytest
$(MAKE) -C test check-short
# Note for 2.6 use <=3.0.1 see requirements-dev.txt
#: Tests for Python 2.7, 3.3 and 3.4
check-2.7 check-3.3 check-3.4: pytest
check-2.6 check-2.7 check-3.3 check-3.4 check-3.5: pytest
$(MAKE) -C test $@
#: Tests for Python 3.2 and 3.5 - pytest doesn't work here
# Or rather 3.5 doesn't work not on Travis
check-3.0 check-3.1 check-3.2 check-3.5 check-3.6:
check-3.0 check-3.1 check-3.2 check-3.6:
$(MAKE) -C test $@
check-3.7: pytest
#:Tests for Python 2.6 (doesn't have pytest)
check-2.6:
$(MAKE) -C test $@
#:PyPy 2.6.1 PyPy 5.0.1, or PyPy 5.8.0-beta0
# Skip for now
2.6 5.0 5.3 5.6 5.8:

65
NEWS
View File

@@ -1,3 +1,48 @@
uncompyle6 3.1.3 2018-04-16
- Add some Python 3.7 rules, such as for handling LOAD_METHOD (not complete)
- Fix some fragment bugs
- small doc changes
uncompyle6 3.1.2 2018-04-08 Eastern Orthodox Easter
- Python 3.x subclass and call parsing fixes
- Allow/note running on Python 3.1
- improve 3.5+ BUILD_MAP_UNPACK
- DRY instruction building code between 2.x and 3.x
- expand testing
uncompyle6 3.1.1 2018-04-01 Easter April Fool's
Jesus on Friday's New York Times puzzle: "I'm stuck on 2A"
- fill out 3.5+ BUILD_MAP_UNPACK (more work is needed)
- fill out 3.4+ CALL_FUNCTION_... (more work is needed)
- fill out 3.5 MAKE_FUNCTION (more work is needed)
- reduce 3.5, 3.6 control-flow bugs
- reduce ambiguity in rules that lead to long (exponential?) parses
- limit/isolate some 2.6/2.7,3.x grammar rules
- more runtime testing of decompiled code
- more removal of parenthesis around calls via setting precidence
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
@@ -10,7 +55,7 @@ uncompyle6 3.0.0 2018-02-17
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 byecode array based. There was and still is code that had
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
@@ -28,7 +73,7 @@ uncompyle6 2.16.0 2018-02-17
- Better 2.7 end_if and COME_FROM determination
- Fix up 3.6+ CALL_FUNCTION_EX
- Misc pydisasm fixes
- Wierd comprehension bug seen via new loctraceback
- 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
@@ -81,7 +126,7 @@ Decompilation bug fixes, mostly 3.6 and pre 2.7
- limit pypy customization to pypy
- Add addr fields in COME_FROMS
- Allow use of full instructions in parser reduction routines
- Reduce grammar in Pythion 3 by specialization more to specific
- Reduce grammar in Python 3 by specialization more to specific
Python versions
- Match Python AST names more closely when possible
@@ -99,7 +144,7 @@ uncompyle6 2.14.0 2017-11-26 johnnybamazing
and remove used grammar rules
- Fix a number of bytecode decompile problems
(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
@@ -123,7 +168,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,
well, *fragments*.
- 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
- Revise how to report a bug
@@ -158,8 +203,8 @@ uncompyle6 2.11.4 2017-08-15
* 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
* unpin 3.5.1. xdis 3.5.4 has been releasd and fixes the problems we had. Use that.
* some routnes here moved to xdis. Use the xdis version
* unpin 3.5.1. xdis 3.5.4 has been release and fixes the problems we had. Use that.
* some routines here moved to xdis. Use the xdis version
* README.rst: Link typo Name is trepan2 now not trepan
* xdis-forced change adjust for COMPARE_OP "is-not" in
semanatic routines. We need "is not".
@@ -255,9 +300,9 @@ uncompyle6 2.9.8 2016-12-16
- fix bug in --verify option
- DRY (a little) control-flow detection
- 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
- verifycall fixes for Python <= 2.4
- verify call fixes for Python <= 2.4
- more Python lint
uncompyle6 2.9.7 2016-12-16
@@ -293,7 +338,7 @@ uncompyle6 2.9.6 2016-11-20
in the results.
- better control flow debugging output
- 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

View File

@@ -52,8 +52,17 @@ 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
and the best all-around Python support.
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 htose 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 are serious about testing, and use automated processes to find
bugs. In the issue trackers for other decompilers, you will find a
@@ -136,26 +145,26 @@ 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.
*Verification* is the process of decompiling bytecode, compiling with
a Python for that bytecode version, and then comparing the bytecode
produced by the decompiled/compiled program. Some allowance is made
for inessential differences. But other semantically equivalent
differences are not caught. For example ``1 and 0`` is decompiled to
the equivalent ``0``; remnants of the first true evaluation (1) is
lost when Python compiles this. When Python next compiles ``0`` the
resulting code is simpler.
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 is no longer feasible.
*Weak Verification*
on the other hand doesn't check bytecode for equivalence but does
check to see if the resulting decompiled source is a valid Python
program by running the Python interpreter. Because the Python language
has changed so much, for best results you should use the same Python
Version in checking as used in the bytecode.
There is a kind of *weak verification* that we use that doesn't check
bytecode for equivalence but does check to see if the resulting
decompiled source is a valid Python program by running the Python
interpreter. Because the Python language has changed so much, for best
results you should use the same Python version in checking as was used
in creating the bytecode.
Finally, we have automated running the standard Python tests after
first compiling and decompiling the test program. Results here are a
bit weak (if not better than most other Python decompilers). But over
time this will probably get better.
There are however an interesting class of these programs that is
readily available give stronger verification: those programs that
when run check some computation, or even better themselves.
And already Python has a set of programs like this: the test suite
for the standard library that comes with Python. We have some
code in `test/stdlib` to facilitate this kind of checking.
Python support is strongest in Python 2 for 2.7 and drops off as you
get further away from that. Support is also probably pretty good for
@@ -203,7 +212,7 @@ There is lots to do, so please dig in and help.
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 Python 3 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://github.com/figment/unpyc3/ : fork of above, but supports Python 3.3 only. Includes some fixes like supporting function annotations
* The HISTORY_ file.

View File

@@ -56,9 +56,9 @@ entry_points = {
]}
ftp_url = None
install_requires = ['spark-parser >= 1.8.5, < 1.9.0',
'xdis >= 3.6.9, < 3.7.0', 'six']
'xdis >= 3.8.0, < 3.9.0', 'six']
license = 'MIT'
license = 'GPL3'
mailing_list = 'python-debugger@googlegroups.com'
modname = 'uncompyle6'
py_modules = None

15
admin-tools/pycdc-runtests.sh Executable file
View File

@@ -0,0 +1,15 @@
#!/bin/bash
# Use pycdc to run our test/bytecode* test suite
bs=${BASH_SOURCE[0]}
testdir=$(dirname $bs)/../test
fulldir=$(readlink -f $testdir)
cd $fulldir
for dir in bytecode_* ; do
echo ========= $dir ================
cd $fulldir/$dir
for file in *.pyc; do
if ! pycdc $file > /dev/null ; then
echo ----- $dir/$file ------
fi
done
done

View 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.3 3.6.3 2.6.9 3.3.6 2.7.14 3.4.2'
export PYVERSIONS='3.5.5 3.6.5 2.6.9 3.3.7 2.7.14 3.2.6 3.1.5 3.4.8'

View 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

View File

@@ -1,5 +1,5 @@
#!/bin/bash
PYTHON_VERSION=3.6.3
PYTHON_VERSION=3.6.4
# FIXME put some of the below in a common routine
function finish {

View File

@@ -0,0 +1,32 @@
#!/bin/bash
# Use pycdc to run our test/bytecode_2.7* test suite
bs=${BASH_SOURCE[0]}
topdir=$(dirname $bs)/..
(cd $topdir && pyenv local 2.7.14)
testdir=$topdir/test
fulldir=$(readlink -f $testdir)
cd $fulldir
for bytecode in bytecode_2.7/*.pyc ; do
echo $bytecode
uncompyle2 $bytecode > /dev/null
echo ================ $bytecode rc: $? ==============
done
tmpdir=/tmp/test-2.7
( cd bytecode_2.7_run &&
mkdir $tmpdir || true
for bytecode in *.pyc ; do
shortname=$(basename $bytecode .pyc)
echo $bytecode
py_file=${tmpdir}/${shortname}.py
typeset -i rc=0
uncompyle2 $bytecode > $py_file
rc=$?
if (( rc == 0 )); then
python $py_file
rc=$?
fi
echo ================ $bytecode rc: $rc ==============
done
)

View File

@@ -1,8 +1,6 @@
#!/usr/bin/env python
from uncompyle6 import PYTHON_VERSION, IS_PYPY
from uncompyle6.scanner import get_scanner
from xdis.bytecode import Bytecode
from array import array
def bug(state, slotstate):
if state:
if slotstate is not None:
@@ -24,16 +22,8 @@ def bug_loop(disassemble, tb=None):
def test_if_in_for():
code = bug.__code__
scan = get_scanner(PYTHON_VERSION)
print(PYTHON_VERSION)
if 2.7 <= PYTHON_VERSION <= 3.0 and not IS_PYPY:
n = scan.setup_code(code)
bytecode = Bytecode(code, scan.opc)
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_instructions(code)
fjt = scan.find_jump_targets(False)
## FIXME: the data below is wrong.
@@ -48,14 +38,7 @@ def test_if_in_for():
# {'start': 62, 'end': 63, 'type': 'for-else'}]
code = bug_loop.__code__
n = scan.setup_code(code)
bytecode = Bytecode(code, scan.opc)
scan.build_lines_data(code, n)
scan.insts = list(bytecode)
scan.build_prev_op(n)
scan.offset2inst_index = {}
for i, inst in enumerate(scan.insts):
scan.offset2inst_index[inst.offset] = i
scan.build_instructions(code)
fjt = scan.find_jump_targets(False)
assert{64: [42], 67: [42, 42], 42: [16, 41], 19: [6]} == fjt
assert scan.structs == [
@@ -69,14 +52,7 @@ def test_if_in_for():
{'start': 48, 'end': 67, 'type': 'while-loop'}]
elif 3.2 < PYTHON_VERSION <= 3.4:
bytecode = Bytecode(code, scan.opc)
scan.code = array('B', code.co_code)
scan.lines = scan.build_lines_data(code)
scan.build_prev_op()
scan.insts = list(bytecode)
scan.offset2inst_index = {}
for i, inst in enumerate(scan.insts):
scan.offset2inst_index[inst.offset] = i
scan.build_instructions(code)
fjt = scan.find_jump_targets(False)
assert {69: [66], 63: [18]} == fjt
assert scan.structs == \
@@ -86,5 +62,6 @@ def test_if_in_for():
{'end': 59, 'type': 'for-loop', 'start': 31},
{'end': 63, 'type': 'for-else', 'start': 62}]
else:
assert True, "FIXME: should note fixed"
print("FIXME: should fix for %s" % PYTHON_VERSION)
assert True
return

View File

@@ -6,7 +6,7 @@ import pytest
# uncompyle
from validate import validate_uncompyle
from test_fstring import expressions
from uncompyle6 import PYTHON_VERSION
alpha = st.sampled_from(string.ascii_lowercase)
numbers = st.sampled_from(string.digits)
@@ -81,10 +81,11 @@ def function_calls(draw,
def test_function_no_args():
validate_uncompyle("fn()")
@pytest.mark.skipif(PYTHON_VERSION < 2.7,
reason="need at least Python 2.7")
def isolated_function_calls(which):
"""
Returns a strategy for generating function calls, but isolated to
Returns a strategy for generating function calls, but isolated to
particular types of arguments, for example only positional arguments.
This can help reason about debugging errors in specific types of function
@@ -108,21 +109,29 @@ def isolated_function_calls(which):
with settings(max_examples=25):
@pytest.mark.skipif(PYTHON_VERSION < 2.7,
reason="need at least Python 2.7")
@given(isolated_function_calls('positional'))
@example("fn(0)")
def test_function_positional_only(expr):
validate_uncompyle(expr)
@pytest.mark.skipif(PYTHON_VERSION < 2.7,
reason="need at least Python 2.7")
@given(isolated_function_calls('keyword'))
@example("fn(a=0)")
def test_function_call_keyword_only(expr):
validate_uncompyle(expr)
@pytest.mark.skipif(PYTHON_VERSION < 2.7,
reason="need at least Python 2.7")
@given(isolated_function_calls('star'))
@example("fn(*items)")
def test_function_call_star_only(expr):
validate_uncompyle(expr)
@pytest.mark.skipif(PYTHON_VERSION < 2.7,
reason="need at least Python 2.7")
@given(isolated_function_calls('double_star'))
@example("fn(**{})")
def test_function_call_double_star_only(expr):

View File

@@ -18,46 +18,48 @@ def test_grammar():
right_recursive, dup_rhs) = p.check_sets()
# We have custom rules that create the below
expect_lhs = set(['expr1024', 'pos_arg', 'get_iter', 'attribute'])
expect_lhs = set(['pos_arg', 'get_iter', 'attribute'])
unused_rhs = set(['list', 'mkfunc',
'mklambda',
'unpack',])
expect_right_recursive = set([('designList',
('store', 'DUP_TOP', 'designList'))])
if PYTHON3:
expect_lhs.add('load_genexpr')
if PYTHON_VERSION != 3.7:
unused_rhs.add('call')
if PYTHON_VERSION > 2.6:
expect_lhs.add('kvlist')
expect_lhs.add('kv3')
unused_rhs.add('dict')
if PYTHON3:
expect_lhs.add('load_genexpr')
unused_rhs = unused_rhs.union(set("""
except_pop_except generator_exp classdefdeco2
dict
except_pop_except generator_exp
""".split()))
if PYTHON_VERSION >= 3.0:
expect_lhs.add("annotate_arg")
expect_lhs.add("annotate_tuple")
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:
unused_rhs.add("dict_comp")
unused_rhs.add("classdefdeco1")
if PYTHON_VERSION != 3.6:
if PYTHON_VERSION in (3.5, 3.7):
expect_right_recursive.add((('l_stmts',
('lastl_stmt', 'COME_FROM', 'l_stmts'))))
('lastl_stmt', 'come_froms', 'l_stmts'))))
pass
pass
else:
expect_right_recursive.add((('l_stmts',
('lastl_stmt', 'COME_FROM', 'l_stmts'))))
# expect_lhs.add('kwargs1')
pass
pass
pass
else:
expect_lhs.add('kwarg')
unused_rhs.add('call')
assert expect_lhs == set(lhs)
assert unused_rhs == set(rhs)
@@ -85,6 +87,8 @@ def test_grammar():
""".split())
if 2.6 <= PYTHON_VERSION <= 2.7:
opcode_set = set(s.opc.opname).union(ignore_set)
if PYTHON_VERSION == 2.6:
opcode_set.add("THEN")
check_tokens(tokens, opcode_set)
elif PYTHON_VERSION == 3.4:
ignore_set.add('LOAD_CLASSNAME')

View File

@@ -1,6 +1,8 @@
import pytest
from uncompyle6 import PYTHON_VERSION, PYTHON3, deparse_code
from uncompyle6 import PYTHON_VERSION, deparse_code
@pytest.mark.skip(PYTHON_VERSION < 2.7,
reason="need at least Python 2.7")
def test_single_mode():
single_expressions = (
'i = 1',

View File

@@ -1,3 +1,3 @@
pytest>=3.0.0
pytest>=3.0.0,<=3.0.1
flake8
hypothesis<=3.8.3
hypothesis<=3.0.0

View File

@@ -4,12 +4,12 @@ import sys
"""Setup script for the 'uncompyle6' distribution."""
SYS_VERSION = sys.version_info[0:2]
if not ((2, 6) <= SYS_VERSION <= (3, 7)) or ((3, 0) <= SYS_VERSION <= (3, 1)):
mess = "Python Release 2.6 .. 3.7 excluding 3.0 and 3.1 are supported in this code branch."
if not ((2, 6) <= SYS_VERSION <= (3, 7)) or ((3, 0) <= SYS_VERSION <= (3, 0)):
mess = "Python Release 2.6 .. 3.7 excluding 3.0 are supported in this code branch."
if ((2, 4) <= SYS_VERSION <= (2, 7)):
mess += ("\nFor your Python, version %s, use the python-2.4 code/branch." %
sys.version[0:3])
elif SYS_VERSION < (2, 4) or ((3, 0) <= SYS_VERSION <= (3, 1)):
elif SYS_VERSION < (2, 4) or (3, 0) <= SYS_VERSION:
mess += ("\nThis package is not supported for Python version %s."
% sys.version[0:3])
print(mess)

1
test/.gitignore vendored Normal file
View File

@@ -0,0 +1 @@
/nohup.out

View File

@@ -2,11 +2,11 @@ PHONY=check clean dist distclean test test-unit test-functional rmChangeLog clea
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
check-3.4 check-3.5 check-3.6 check-3.7 check-5.6 5.6 5.8 \
grammar-coverage-2.5 grammar-coverage-2.6 grammar-coverage-2.7 \
grammar-coverage-3.1 grammar-coverage-3.2 grammar-coverage-3.3 \
grammar-coverage-3.4 grammar-coverage-3.5 grammar-coverage-3.6 \
grammar-coverage-3.7
GIT2CL ?= git2cl
PYTHON ?= python
@@ -37,27 +37,36 @@ check-3.0: check-bytecode
#: Run working tests from Python 3.1
check-3.1: check-bytecode
$(PYTHON) test_pythonlib.py --bytecode-3.1 --weak-verify $(COMPILE)
$(PYTHON) test_pythonlib.py --bytecode-3.1-run --verify-run
#: Run working tests from Python 3.2
check-3.2: check-bytecode
$(PYTHON) test_pythonlib.py --bytecode-3.2 --weak-verify $(COMPILE)
$(PYTHON) test_pythonlib.py --bytecode-3.2-run --verify-run
#: Run working tests from Python 3.3
check-3.3: check-bytecode
$(PYTHON) test_pythonlib.py --bytecode-3.3 --weak-verify $(COMPILE)
$(PYTHON) test_pythonlib.py --bytecode-3.3-run --verify-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 --weak-verify $(COMPILE)
$(PYTHON) test_pythonlib.py --bytecode-3.4-run --verify-run
#: Run working tests from Python 3.5
check-3.5: check-bytecode
$(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
check-3.6: check-bytecode
$(PYTHON) test_pythonlib.py --bytecode-3.6 --weak-verify $(COMPILE)
#: Run working tests from Python 3.7
check-3.7: check-bytecode
$(PYTHON) test_pythonlib.py --bytecode-3.7 --weak-verify $(COMPILE)
# FIXME
#: this is called when running under pypy3.5-5.8.0 or pypy2-5.6.0
5.8 5.6:
@@ -113,23 +122,29 @@ check-bytecode-2.4:
check-bytecode-2.5:
$(PYTHON) test_pythonlib.py --bytecode-2.5
#: Get grammar coverage for Python 2.4
grammar-coverage-2.4:
-rm $(COVER_DIR)/spark-grammar-24.cover
SPARK_PARSER_COVERAGE=$(COVER_DIR)/spark-grammar-2.4.cover $(PYTHON) test_pythonlib.py --bytecode-2.4
SPARK_PARSER_COVERAGE=$(COVER_DIR)/spark-grammar-2.4.cover $(PYTHON) test_pyenvlib.py --2.4.6 --max= 800
#: Get grammar coverage for Python 2.5
grammar-coverage-2.5:
-rm $(COVER_DIR)/spark-grammar-25.cover
SPARK_PARSER_COVERAGE=$(COVER_DIR)/spark-grammar-25.cover $(PYTHON) test_pythonlib.py --bytecode-2.5
SPARK_PARSER_COVERAGE=$(COVER_DIR)/spark-grammar-25.cover $(PYTHON) test_pyenvlib.py --2.5.6
-rm $(COVER_DIR)/spark-grammar-2.5.cover || true
SPARK_PARSER_COVERAGE=$(COVER_DIR)/spark-grammar-2.5.cover $(PYTHON) test_pythonlib.py --bytecode-2.5
SPARK_PARSER_COVERAGE=$(COVER_DIR)/spark-grammar-2.5.cover $(PYTHON) test_pyenvlib.py --2.5.6 --max=800
#: Get grammar coverage for Python 2.6
grammar-coverage-2.6:
-rm $(COVER_DIR)/spark-grammar-26.cover
SPARK_PARSER_COVERAGE=$(COVER_DIR)/spark-grammar-26.cover $(PYTHON) test_pythonlib.py --bytecode-2.6
SPARK_PARSER_COVERAGE=$(COVER_DIR)/spark-grammar-26.cover $(PYTHON) test_pyenvlib.py --2.6.9
-rm $(COVER_DIR)/spark-grammar-2.6.cover || true
SPARK_PARSER_COVERAGE=$(COVER_DIR)/spark-grammar-2.6.cover $(PYTHON) test_pythonlib.py --bytecode-2.6
SPARK_PARSER_COVERAGE=$(COVER_DIR)/spark-grammar-2.6.cover $(PYTHON) test_pyenvlib.py --2.6.9 --max=800
#: Get grammar coverage for Python 2.7
grammar-coverage-2.7:
-rm $(COVER_DIR)/spark-grammar-27.cover
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
-rm $(COVER_DIR)/spark-grammar-2.7.cover || true
SPARK_PARSER_COVERAGE=$(COVER_DIR)/spark-grammar-2.7.cover $(PYTHON) test_pythonlib.py --bytecode-2.7
SPARK_PARSER_COVERAGE=$(COVER_DIR)/spark-grammar-2.7.cover $(PYTHON) test_pyenvlib.py --2.7.14 --max=600
#: Get grammar coverage for Python 3.0
grammar-coverage-3.0:
@@ -140,33 +155,39 @@ SPARK_PARSER_COVERAGE=$(COVER_DIR)/spark-grammar-30.cover $(PYTHON) test_pythonl
#: 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
-rm $(COVER_DIR)/spark-grammar-3.1.cover
SPARK_PARSER_COVERAGE=$(COVER_DIR)/spark-grammar-3.1.cover $(PYTHON) test_pythonlib.py --bytecode-3.1
SPARK_PARSER_COVERAGE=$(COVER_DIR)/spark-grammar-3.1.cover $(PYTHON) test_pyenvlib.py --3.1.5
#: Get grammar coverage for Python 3.2
grammar-coverage-3.2:
-rm $(COVER_DIR)/spark-grammar-32.cover
SPARK_PARSER_COVERAGE=$(COVER_DIR)/spark-grammar-32.cover $(PYTHON) test_pythonlib.py --bytecode-3.2
SPARK_PARSER_COVERAGE=$(COVER_DIR)/spark-grammar-32.cover $(PYTHON) test_pyenvlib.py --3.2.6
-rm $(COVER_DIR)/spark-grammar-3.2.cover || true
SPARK_PARSER_COVERAGE=$(COVER_DIR)/spark-grammar-3.2.cover $(PYTHON) test_pythonlib.py --bytecode-3.2
SPARK_PARSER_COVERAGE=$(COVER_DIR)/spark-grammar-3.2.cover $(PYTHON) test_pyenvlib.py --3.2.6
#: Get grammar coverage for Python 3.3
grammar-coverage-3.3:
-rm $(COVER_DIR)/spark-grammar-33.cover
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
-rm $(COVER_DIR)/spark-grammar-3.3.cover || true
SPARK_PARSER_COVERAGE=$(COVER_DIR)/spark-grammar-3.3.cover $(PYTHON) test_pythonlib.py --bytecode-3.3
SPARK_PARSER_COVERAGE=$(COVER_DIR)/spark-grammar-3.3.cover $(PYTHON) test_pyenvlib.py --3.3.7 --max=800
#: Get grammar coverage for Python 3.4
grammar-coverage-3.4:
-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_pyenvlib.py --3.4.2
-rm $(COVER_DIR)/spark-grammar-3.4.cover || true
SPARK_PARSER_COVERAGE=$(COVER_DIR)/spark-grammar-3.4.cover $(PYTHON) test_pythonlib.py --bytecode-3.4
SPARK_PARSER_COVERAGE=$(COVER_DIR)/spark-grammar-3.4.cover $(PYTHON) test_pyenvlib.py --3.4.8 --max=800
#: Get grammar coverage for Python 3.5
grammar-coverage-3.5:
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_pyenvlib.py --3.5.3
rm $(COVER_DIR)/spark-grammar-3.5.cover || /bin/true
SPARK_PARSER_COVERAGE=$(COVER_DIR)/spark-grammar-3.5.cover $(PYTHON) test_pythonlib.py --bytecode-3.5
SPARK_PARSER_COVERAGE=$(COVER_DIR)/spark-grammar-3.5.cover $(PYTHON) test_pyenvlib.py --3.5.5 --max=450
#: Get grammar coverage for Python 3.6
grammar-coverage-3.6:
rm $(COVER_DIR)/spark-grammar-3.6.cover || /bin/true
SPARK_PARSER_COVERAGE=$(COVER_DIR)/spark-grammar-3.6.cover $(PYTHON) test_pythonlib.py --bytecode-3.6
SPARK_PARSER_COVERAGE=$(COVER_DIR)/spark-grammar-3.6.cover $(PYTHON) test_pyenvlib.py --3.6.4 --max=280
#: Check deparsing Python 2.6
check-bytecode-2.6:
@@ -185,10 +206,12 @@ check-bytecode-3.0:
#: Check deparsing Python 3.1
check-bytecode-3.1:
$(PYTHON) test_pythonlib.py --bytecode-3.1 --weak-verify
$(PYTHON) test_pythonlib.py --bytecode-3.1-run --verify-run
#: Check deparsing Python 3.2
check-bytecode-3.2:
$(PYTHON) test_pythonlib.py --bytecode-3.2 --weak-verify
$(PYTHON) test_pythonlib.py --bytecode-3.2-run --verify-run
#: Check deparsing Python 3.3
check-bytecode-3.3:
@@ -210,6 +233,10 @@ check-bytecode-3.6:
$(PYTHON) test_pythonlib.py --bytecode-3.6 --weak-verify
$(PYTHON) test_pythonlib.py --bytecode-3.6-run --verify-run
#: Check deparsing Python 3.7
check-bytecode-3.7:
$(PYTHON) test_pythonlib.py --bytecode-3.7 --weak-verify
#: short tests for bytecodes only for this version of Python
check-native-short:
$(PYTHON) test_pythonlib.py --bytecode-$(PYTHON_VERSION) --weak-verify $(COMPILE)

Binary file not shown.

View File

@@ -1,5 +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
Furthermore, the programs here are self-checking: when decompiled and
then run again in a 2.4 interpreter, they are likely to give an error when they
are miscompiled.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@@ -1,5 +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.
Furthermore the programs here are self-checking: when decompiled and
then run again in a 2.5 interpreter, they are likely to give an error
when they are miscompiled.

Binary file not shown.

Binary file not shown.

View File

@@ -1,5 +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.
Furthermore the programs here are self-checking: when decompiled and
then run again in a 2.6 interpreter, they are likely to give an error
when they are miscompiled.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@@ -1,5 +1,5 @@
These are byte-compiled programs compiled by Python 2.7.
Furthrmore the programs here are self-checking: when decompiled and
then run again in a 2.7 interpreter, they will give an error if they
are miscompiled.
Furthermore, the programs here are self-checking: when decompiled and
then run again in a 2.7 interpreter, they are likely to give an error
when they are miscompiled.

Binary file not shown.

View File

@@ -1,5 +1,5 @@
These are byte-compiled programs compiled by Python 3.0.
Furthrmore the programs here are self-checking: when decompiled and
then run again in a 3.0 interpreter, they will give an error if they
are miscompiled.
Furthermore, the programs here are self-checking: when decompiled and
then run again in a 3.0 interpreter, they are likely to give an error
when they are miscompiled.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@@ -1,5 +1,5 @@
These are byte-compiled programs compiled by Python 3.1.
Furthrmore the programs here are self-checking: when decompiled and
then run again in a 3.1 interpreter, they will give an error if they
are miscompiled.
Furthrmore, the programs here are self-checking: when decompiled and
then run again in a 3.1 interpreter, they are likely to give an error
when they are miscompiled.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@@ -1,5 +1,5 @@
These are byte-compiled programs compiled by Python 3.2.
Furthrmore the programs here are self-checking: when decompiled and
then run again in a 3.2 interpreter, they will give an error if they
are miscompiled.
Furthermore, the programs here are self-checking: when decompiled and
then run again in a 3.2 interpreter, they are likely to give an error
when they are miscompiled.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@@ -1,5 +1,5 @@
These are byte-compiled programs compiled by Python 3.3.
Furthrmore the programs here are self-checking: when decompiled and
then run again in a 3.3 interpreter, they will give an error if they
are miscompiled.
Furthermore, the programs here are self-checking: when decompiled and
then run again in a 3.3 interpreter, they are likely to give an error
when they are miscompiled.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@@ -1,5 +1,5 @@
These are byte-compiled programs compiled by Python 3.4.
Furthrmore the programs here are self-checking: when decompiled and
then run again in a 3.4 interpreter, they will give an error if they
are miscompiled.
Furthermore, the programs here are self-checking: when decompiled and
then run again in a 3.4 interpreter, they are likely to give an error
when they are miscompiled.

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.

View File

@@ -1,5 +1,5 @@
These are byte-compiled programs compiled by Python 3.5.
Furthrmore the programs here are self-checking: when decompiled and
then run again in a 3.5 interpreter, they will give an error if they
are miscompiled.
Furthrmore, the programs here are self-checking: when decompiled and
then run again in a 3.5 interpreter, they are likely to give an error
when they are miscompiled.

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.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@@ -0,0 +1,5 @@
These are byte-compiled programs compiled by Python 3.6.
Furthrmore, the programs here are self-checking: when decompiled and
then run again in a 3.6 interpreter, they are likely to give an error
when they are miscompiled.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Some files were not shown because too many files have changed in this diff Show More