Compare commits

...

1223 Commits

Author SHA1 Message Date
rocky
4e6c449250 Merge branch 'master' into python-2.4 2020-02-09 13:30:18 -05:00
rocky
e342ef89e3 Get ready for release 3.6.4 2020-02-09 13:26:53 -05:00
rocky
57d59aa481 Update README.rst 2020-02-09 12:44:21 -05:00
rocky
da119a31f7 Update README.rst 2020-02-09 12:41:52 -05:00
rocky
ae9f83c191 CircleCI try 15 2020-02-09 10:49:58 -05:00
rocky
846020bf5a CircleCI try 14 2020-02-09 10:46:21 -05:00
rocky
cf5c81ab21 CircleCI try 13 2020-02-09 10:44:27 -05:00
rocky
244ab4e3b3 CircleCI try 12 2020-02-09 10:43:24 -05:00
rocky
07290bd443 CircleCI try 11 2020-02-09 10:42:28 -05:00
rocky
ef9c34098a CircleCI try 10 2020-02-09 10:41:30 -05:00
rocky
57bca5102d CircleCI try 9 2020-02-09 10:32:05 -05:00
rocky
a29d1e1531 CircleCI try 8 2020-02-09 10:28:20 -05:00
rocky
3d649e049b CircleCI try 7 2020-02-09 10:27:01 -05:00
rocky
26a7b984aa CircleCI try 6 2020-02-09 10:17:09 -05:00
rocky
9b41dfd951 CircleCI try 5 2020-02-09 10:14:41 -05:00
rocky
1091d32882 CircleCI try 4 2020-02-09 10:09:37 -05:00
rocky
432859d677 CircleCI try 3 2020-02-09 10:04:30 -05:00
rocky
25b7752915 CircleCI try 2 2020-02-09 10:01:54 -05:00
rocky
bac3fea8cd Merge branch 'master' into python-2.4 2020-02-09 09:55:41 -05:00
rocky
6545d9a03b runtests excludes again 2020-02-09 09:42:38 -05:00
rocky
8ac35ad8ce Need to back off ifelsetesting on 2.7...
until we can more fully untangle if stmts in loops.
Current tests break urllib2.pyc and cgi.pyc
2020-02-09 09:01:32 -05:00
rocky
8836444be2 Correct ifelsestmtc rules for 3.x 2020-02-09 08:14:44 -05:00
rocky
339b4c56ee Typo 2020-02-09 07:38:32 -05:00
rocky
6cbb631aa6 In lambda code we, no stinking bogus yield 2020-02-09 07:32:06 -05:00
rocky
5355cb5404 async with rules back to 3.5 and ...
add precidence on cascaded "await" expressions
2020-02-08 20:31:06 -05:00
rocky
8495d208fb 3.7+ "async with" handling from decompyle3 2020-02-08 19:48:09 -05:00
rocky
e1758a8730 3.5 runtests exclusions 2020-02-08 15:50:12 -05:00
rocky
c1a825fbbb 3.6 runtests exclusions 2020-02-08 15:46:00 -05:00
rocky
8f2e408da2 Another 3.5 runtest exclusion 2020-02-08 15:25:42 -05:00
rocky
e2504c2421 3.7 ifelstmtl reduction rule checking 2020-02-08 13:47:05 -05:00
rocky
1d7085e5d2 Add 3.5 runtest exclusion 2020-02-08 12:07:35 -05:00
rocky
65707fa0f8 FIx bug that snuck in last commit. 2020-02-08 12:01:56 -05:00
rocky
b0931275a2 Need more precise "assert" for 3.8...
Add rule for ifelsestmtl which is needed in 3.8
2020-02-08 11:46:19 -05:00
rocky
7c73536b4a 3.6 "assert" and "or" handling bugs 2020-02-08 07:27:31 -05:00
rocky
946d46a574 Fix Python 3.6 "if" parse failures in loops...
This fixes all the pyenv parse errors that were introduced in the last refactor.
2020-02-08 05:21:42 -05:00
rocky
2b50cb56d7 One more 3.6 runtest exclude 2020-02-07 20:53:31 -05:00
rocky
6d5fb21363 Go over 3.2-3.6 runtests.sh exludes...
Reinstate a lot of tests broken since c90ff51
2020-02-07 20:09:40 -05:00
rocky
bd7d74fa5d 3.7 excludes again 2020-02-07 19:44:24 -05:00
rocky
c93a7a728b Add decompyle3 ifelsestmt reduction rule...
and Go over 3.3 and 3.7 runtests excludes
2020-02-07 19:22:23 -05:00
R. Bernstein
26a554c5c7 Merge pull request #306 from rocky/ifexp_from_conditional
if_exp from conditional
2020-02-07 18:26:12 -05:00
rocky
cb35ad906c One more if_exp use (ret_cond) 2020-02-07 16:34:48 -05:00
rocky
278af38df6 conditional -> if_exp ...
to match Python IfExp AST
2020-02-07 16:17:47 -05:00
rocky
7fb50918cd Bug in "async for" indentation 2020-02-06 23:54:03 -05:00
rocky
6525ade805 Comment tweaks 2020-02-06 20:37:40 -05:00
rocky
73951840b6 Correct last commit 2020-02-06 20:19:29 -05:00
rocky
3438e76865 "return locals()" change to track grammar change 2020-02-06 20:08:00 -05:00
rocky
7480af33d9 CircleCI again 2020-02-06 05:24:02 -05:00
rocky
88b2be70d2 CircleCI again 2020-02-06 05:22:48 -05:00
rocky
73de86728a CircleCI again 2020-02-06 05:21:45 -05:00
rocky
f743639bb6 CircleCI again 2020-02-06 05:20:02 -05:00
rocky
321c7906cd CircleCI again 2020-02-06 05:18:35 -05:00
rocky
06b281d1d8 Try to expand CircleCI testing 2020-02-06 05:14:29 -05:00
rocky
a99d8da0b4 Fix Recent CI bug 2020-02-06 05:10:57 -05:00
rocky
73e6409594 Fix recent CI bug 2020-02-06 05:09:17 -05:00
rocky
e93628d2dd Update CircleCI to test with 3.6.10 2020-02-06 05:04:39 -05:00
rocky
e41cd9be84 hide __qualname__ and name modules again...
due to recent grammar change
2020-02-06 03:19:56 -05:00
rocky
9166fb54a1 Adjust a couple of "assert"s 2020-02-04 22:06:48 -05:00
rocky
3120de0c02 Go over older 2.4 runtests failures 2020-02-04 22:01:49 -05:00
rocky
9cc9bceadf Go over older 2.x exclusions 2020-02-04 21:57:20 -05:00
rocky
36e09738c3 Merge branch 'master' into python-2.4 2020-02-04 21:34:15 -05:00
rocky
68c9de60a5 Adjust assert transform for new "if_and" rule 2020-02-04 21:28:08 -05:00
rocky
90439c562f Python 2.5 runtests exclusions 2020-02-04 20:30:19 -05:00
rocky
d9975defe9 Merge branch 'master' into python-2.4 2020-02-04 20:21:35 -05:00
rocky
621bc96e8a Ensure offset is an int in offset test 2020-02-04 20:20:40 -05:00
rocky
6f4ec21ae2 __modname__ and __qualname__ detection...
since grammar has simplified.

May still need work for Python < 3.0
2020-02-02 19:09:50 -05:00
rocky
83e27bc427 Reinstate some 3.0 tests 2020-02-02 17:45:17 -05:00
rocky
9aae8f85c7 Bug introduced by last commit 2020-02-02 13:11:03 -05:00
rocky
04f8619cf1 Better docstring recognition 2020-02-02 13:02:37 -05:00
rocky
610994277c 2.7 ifelsestmt reduction rule futzing 2020-02-02 07:52:08 -05:00
rocky
6fff0fc5a2 More assert transform opportunities 2020-02-02 06:46:48 -05:00
rocky
e4a196278a More control-flow testing based on past failures...
Some of these still cause problems. Sigh.
2020-02-02 06:08:19 -05:00
rocky
425b50cf1c Merge branch 'master' into python-2.4 2020-02-02 05:38:27 -05:00
rocky
6e5666c001 Merge branch 'master' of github.com:rocky/python-uncompyle6 2020-02-02 05:37:37 -05:00
rocky
38e2b8a10b Go over docstring handling 2020-02-02 05:37:07 -05:00
rocky
2216eb7b01 Merge branch 'master' into python-2.4 2020-02-01 22:29:10 -05:00
rocky
5d1bf2dd9b adjust "assert" transformation due to grammar ...
simplification
2020-02-01 22:27:17 -05:00
rocky
de1e7d423c A more correct offset2inst_index update. 2020-02-01 21:02:45 -05:00
rocky
16a51961c3 Add tests based on recent runtests.sh failures...
These run quicker and are distilled to simple examples.
2020-02-01 20:32:23 -05:00
rocky
0798078d7e See previous commit msg 2020-02-01 12:30:51 -05:00
rocky
db3c687784 See previous commit msg 2020-02-01 12:27:06 -05:00
rocky
0fafb38d35 Typo 2020-02-01 12:14:34 -05:00
rocky
f426101000 Another runtests.sh exclude for now 2020-02-01 12:11:51 -05:00
rocky
cf505545c0 3.6 iflastlstmt rule checking again 2020-02-01 12:00:08 -05:00
rocky
45c725feae 3.6 iflaststmtl doesn't follow ifstmt rules...
like iflaststmt does. test_dbm_dumb.py shows this
2020-02-01 11:20:58 -05:00
rocky
4dc64063d1 Small change 2020-02-01 11:14:19 -05:00
rocky
cdc5642715 More reduction checks...
Those in reduce check as well as those listed in parse{2,3}.

3.6 iflastsmtl needs ifstmt checking.
2020-02-01 07:10:30 -05:00
rocky
4f4850d9f7 Restrict "and" reduction checking to Python 3.6 2020-02-01 04:42:46 -05:00
rocky
451b18ee57 2.7 tryelse rule check disambiguation. 2020-02-01 04:05:50 -05:00
rocky
2d1ea6b02b See previous commit 2020-01-31 21:12:59 -05:00
rocky
f279cc2d70 ifelsesmt for 2.7 yet again 2020-01-31 21:10:24 -05:00
rocky
cb1b2a8759 Typo in last commit 2020-01-31 19:11:13 -05:00
rocky
d64158b299 No iflastlstmt reduce check for python < 3.6...
just yet
2020-01-31 19:07:28 -05:00
rocky
2ea8a2ef7f was getting testlastl reduce rule from wrong place 2020-01-31 17:37:47 -05:00
rocky
258fac3201 limit 3.x scope of ifelstmt reduction check to 3.6
at least for now. Again, we need major cleanup of this stuff, but that
will be done later.
2020-01-31 16:22:32 -05:00
rocky
7c012ebdfc Remove duplicate stmt 2020-01-31 15:50:46 -05:00
rocky
f27b72ab05 Work around 2.7 phony come-froms in ifelsesmt 2020-01-31 15:49:29 -05:00
rocky
be022b3416 Start ifelsestmt reduce checks in Python 2.7 2020-01-31 13:58:06 -05:00
rocky
41f1d1ec09 Remove dup statement 2020-01-31 13:18:23 -05:00
rocky
89c2805c27 Start to clean up parse3 reduction rule checks...
A lot more work is needed, but this is a start.
2020-01-31 13:10:35 -05:00
rocky
e639a30157 Add some decompyle reduction-check goodness here 2020-01-31 12:20:12 -05:00
rocky
ee2a1f62c6 runtests exclude found recently in 3.6 2020-01-31 04:46:25 -05:00
rocky
db46e096b4 See previous commit message 2020-01-31 03:53:35 -05:00
rocky
ea48944fff reinstate a test fixed recently 2020-01-31 03:08:36 -05:00
rocky
31714d3420 compile-file.py: preserve source file location 2020-01-30 21:09:34 -05:00
rocky
6466d30e2e Adjust "ifelsestmt" rule
Fixes #305
2020-01-30 19:45:32 -05:00
rocky
ef61f3a92a Add a 3.6 runtest exclude due to bad control flow 2020-01-30 18:02:44 -05:00
rocky
31468a2328 Merge branch 'master' into python-2.4 2020-01-29 15:39:46 -05:00
rocky
fdf4496a2d Track grammar "stmt" simplifications class ...
* NAME_MODULE constant
* QUAL_NAME constant
2020-01-29 15:37:58 -05:00
rocky
d39191477b Merge branch 'master' into python-2.4 2020-01-28 01:44:05 -05:00
rocky
b548910e57 IMPORT_NAME -> IMPORT_NAME_ATTR
Fixes #304
2020-01-28 01:43:20 -05:00
R. Bernstein
c5f939e90d Merge pull request #302 from hjung4/spell
fix spelling errors
2020-01-27 20:33:01 -05:00
comet
6bbafcc8dd fix spelling errors 2020-01-27 18:41:55 -06:00
rocky
5489ee9857 Merge branch 'master' into python-2.4 2020-01-26 12:15:10 -05:00
rocky
7fc4ccf75a Get ready for release 3.6.3 2020-01-26 12:11:22 -05:00
rocky
f8c437230d Get ready for release 3.6.3 2020-01-26 12:08:40 -05:00
rocky
e30051b460 Merge branch 'master' into python-2.4 2020-01-26 12:00:11 -05:00
rocky
dff3611d16 Tidy runtests.sh more. 2020-01-26 11:52:35 -05:00
rocky
13ca1117ad 3.x "if" in loop grammar separation 2020-01-26 10:32:29 -05:00
rocky
e80e72e6ab ifelsestmt transform must object types more 2020-01-26 10:12:26 -05:00
rocky
b893a9ae21 exclusions again 2020-01-26 09:38:21 -05:00
rocky
24657961d6 exclusions again 2020-01-26 09:33:29 -05:00
rocky
71e9b0d96d More "if" in loop parse separation 2020-01-26 09:25:04 -05:00
rocky
466b894ed4 3.4 exclusions 2020-01-26 08:35:02 -05:00
rocky
1fff81736f parser if-stmt restriction thing & 3.x exclusions 2020-01-26 08:27:49 -05:00
rocky
49df216c67 Need to exclude fstring test 2020-01-26 03:54:55 -05:00
rocky
118e21b2cd A recent changed bolixed docstrings...
fixa
2020-01-26 03:30:57 -05:00
rocky
ba47a8d009 Runtest 3.6 exclusions 2020-01-26 03:03:59 -05:00
rocky
33918bd9d2 More 3.x "if" checking. Abbreviate stmts->sstmt 2020-01-26 02:58:33 -05:00
rocky
7721fbd276 runtest exclusions for POWER (again) 2020-01-26 01:43:21 -05:00
rocky
b5a5a128b5 Runtest exclusion for POWER 2020-01-26 00:23:22 -05:00
rocky
64100bd0c9 Runtest exclusions 2020-01-26 00:11:29 -05:00
rocky
1c172f3962 runtest exclusions 2020-01-25 23:10:27 -05:00
rocky
382a3b1483 3.5 exclusions 2020-01-25 22:26:28 -05:00
rocky
584d663394 runtest exclusions 2020-01-25 22:09:57 -05:00
rocky
a02f490889 Restrict more runtests for now...
Sigh. Forward leaps followed by backward steps. Repeat
2020-01-25 20:59:56 -05:00
rocky
d43972313a Cut-n-paste grammar rule bug 2020-01-25 19:06:41 -05:00
rocky
dac277f1fa Back off loop separate rules, a little for now 2020-01-25 18:07:05 -05:00
rocky
a50263518a 3.x if loop separation 2020-01-25 17:32:28 -05:00
rocky
73fb9f6b96 Make sure "stmts" stays the start rule 2020-01-25 16:14:36 -05:00
rocky
c772972227 Exclusions again. 2020-01-25 13:28:48 -05:00
rocky
f3228162dd scale back on tests until grammar refactor done...
and that will come in the next release
2020-01-25 12:45:01 -05:00
rocky
66b3e35a5b 3.+ More loop-isolation grammar separation...
but also back off some isolation separation for now.
2020-01-25 11:46:03 -05:00
rocky
58f2e19539 Hack around grammar weakness in 3.5..3.6 for now 2020-01-25 10:12:18 -05:00
rocky
f6f2d8dd05 Start to disambiguate stmts in a loop 2020-01-25 09:14:55 -05:00
rocky
13b1ec7ad8 Better "ifstmt" reduction rule and ...
Tidy 3.7 grammar a little
Disable a number of 3.0 bytecode for now. Will Go over later.
2020-01-25 00:04:37 -05:00
rocky
c90ff5176c Add 3.x try reduction rule 2020-01-24 20:48:04 -05:00
rocky
72b053acef Update 2.6 exclusions for runtests 2020-01-24 07:52:24 -05:00
rocky
09195c09fd Go over 3.5.9 runtests.sh 2020-01-24 07:08:37 -05:00
rocky
10695d882e Fix bug in 3.7 chained comparison semantic action 2020-01-24 06:14:28 -05:00
rocky
5c31fdc362 Fix bug in 3.6 handling kwonly params ...
when there are annotation args
2020-01-24 05:47:41 -05:00
rocky
5616f56442 Remove unreachable code from make_function36.py...
with respect to picking out MAKE_FUNCTION attributes.

Fill in runtests.sh exclude lists
2020-01-24 05:05:56 -05:00
rocky
dab7915404 Go over runtests 3.7 excludes 2020-01-24 03:49:12 -05:00
rocky
4067a30573 Fix bug introduced by a recent refactoring 2020-01-24 03:11:51 -05:00
rocky
7e91daf043 3.7 "if" body tweak . 2020-01-23 21:38:47 -05:00
rocky
e76e9b7ab6 ifelsestmt reduce check tracking parse rule change 2020-01-23 20:04:53 -05:00
rocky
1b96402732 More 3.4-3.6 runtest.sh test work now...
Seems to have been the recent fix which limit while1stmt
matching
2020-01-23 15:26:02 -05:00
rocky
0421863cd3 I said 3.4 compatibility! 2020-01-23 13:58:50 -05:00
rocky
e0f5cb2bd2 3.4- compliance 2020-01-23 13:51:46 -05:00
rocky
28a80a0132 3.6+ extended arg handling; sync with decompyle3..
Use 3.8 scanner now.

TODO: Need to investigate what's up with 3.7/01_extended_arg.py
2020-01-23 13:35:22 -05:00
rocky
eeb48818f3 Largish rework: scan while1stmt for jump out ..
to disambiguate.

For this, we use the self.opc JUMP_OPS sets.
For this, we neeed to store opc in the parse object.

DRY uses of "last = min(last, len(tokens))
2020-01-23 13:02:29 -05:00
rocky
0f4b791502 Exclue 3.7 test_binascii.py for now 2020-01-23 11:44:31 -05:00
rocky
96c9058cc1 Mini-sync with decompyle3:
go over runtests.sh 3.8 excludes
2020-01-23 07:00:53 -05:00
rocky
5951f974d5 Fix 3.8 grammar rule bug: "for" with "if"/"return" 2020-01-23 06:07:34 -05:00
rocky
29715bb8bf 3.8 ifelsestmt grammar rule...
and remove optional "c_stmts" in 3.7 "ifelsesmt" rule. We may
have to come back and add something, but when we do we'll be more
careful and this is probably all for the better.
2020-01-22 22:50:27 -05:00
rocky
31481de209 Test for previous commit 2020-01-22 19:24:29 -05:00
rocky
e17d9c806a ifstmt reduction vs extended_args 2020-01-22 19:14:52 -05:00
rocky
c1cde68da8 Change runtests.sh default to stop on 1st error 2020-01-22 14:49:51 -05:00
rocky
018583069b 3.7+ bug in handling extended arg 2020-01-22 14:31:45 -05:00
rocky
dcf7ca1061 Go over runtest exclusions 2020-01-22 07:23:54 -05:00
rocky
ed64e7b443 Check that the jumps to jump fix jumps to a *jump* 2020-01-22 07:07:57 -05:00
rocky
5d64664857 Python 2.6.9 compatibility 2020-01-22 06:27:31 -05:00
rocky
b12893f343 2.4 compatibility 2020-01-22 06:25:58 -05:00
rocky
80b0d4284b Merge branch 'master' into python-2.4 2020-01-22 05:54:20 -05:00
rocky
e07f799cdd 3.7 runtest exclusion update 2020-01-22 05:36:22 -05:00
rocky
bc50825460 Conditional jumps to extended-arg JUMP_BACK...
this is a major reworking. But it leads the way forward to a
simpler grammar.
2020-01-22 05:32:27 -05:00
rocky
c6069eb7f8 Go over 3.7 test exclusions. Some tests now work. 2020-01-21 22:08:57 -05:00
rocky
d2f59189dd Add missing code for n_assert_invert 2020-01-21 21:54:09 -05:00
rocky
03b5fbaeab Split out 2.7 runtest exclusions...
Note why test_compile.py will always fail.
2020-01-21 20:37:42 -05:00
rocky
b91df57a82 Add "ifelsestmt" reduce rule checking 2020-01-21 16:03:12 -05:00
rocky
afedf43ee1 Add "ifelsestmt" reduce rule checking 2020-01-21 16:01:19 -05:00
rocky
8684137f80 Merge branch 'master' into python-2.4 2020-01-21 07:16:36 -05:00
rocky
412a811ddb Go over 2.5 runtest exclusions 2020-01-21 07:15:47 -05:00
rocky
dc16f03f50 Split out 2.5 runtest exclusions to its own file 2020-01-21 07:11:45 -05:00
rocky
2c608c7909 Merge branch 'master' into python-2.4 2020-01-21 06:50:49 -05:00
rocky
73eab178ae Towards syncing with decompyle3 2020-01-21 06:36:54 -05:00
rocky
f4e6382cc1 Specialize "classdef" nonterminal for 3.6+ 2020-01-21 04:56:11 -05:00
rocky
67c37f1a03 blacken yet another buffer 2020-01-21 04:46:04 -05:00
rocky
beac1d3567 Fix a bug in 3.6+ keyword-only argument passing 2020-01-21 04:37:58 -05:00
rocky
e466e826b3 Small bug in 3.6+ in finding class name 2020-01-20 22:43:20 -05:00
rocky
eacc3f5cc7 blacken (reformat) a parser.py 2020-01-18 05:23:16 -05:00
rocky
af7b05922f More exclude 2020-01-17 15:02:54 -05:00
rocky
7a6511307f See above 2020-01-17 14:09:08 -05:00
rocky
26a4577cdb test_tcl.py exclusion for 3.4 2020-01-17 12:44:35 -05:00
rocky
7263b6b15f Go over test exclusions yet again 2020-01-17 12:14:30 -05:00
rocky
e06f0990f8 Go over test data for 3.6 2020-01-17 11:10:14 -05:00
rocky
b333d7afc2 If statement in loop isolation 2020-01-17 10:47:38 -05:00
rocky
4510aa932c Up limits on tests, since we have improved parsing 2020-01-17 06:37:38 -05:00
rocky
d9bc5a345b Don't check iflaststml on 3.2 just yet 2020-01-17 05:42:49 -05:00
rocky
af76218abf More parser changes to reinstate what was working in 3.6.2...
However, again, probably more precise since we isolate loop rules better

However, again, this isnt' the full store. Semantics were incorrect in
Release 3.6.2 and they still are.
2020-01-17 05:36:20 -05:00
rocky
273c4bcbf0 Remove unused rule...
found by test_grammar.py
2020-01-17 05:01:44 -05:00
rocky
7ec1d0e17b Merge branch 'master' of github.com:rocky/python-uncompyle6 2020-01-17 04:44:59 -05:00
rocky
027c9a7dc0 Fix "for ... if" bug introduced since 3.6.2...
However we've isolated and documented the 3.x grammar a little bit better
2020-01-17 04:41:16 -05:00
rocky
6d368d2b30 parens around consts when taking attr again 2020-01-16 22:15:28 -05:00
rocky
549c33113b Exclude recently broken 3.3, and 3.7 tests for now. 2020-01-16 14:12:50 -05:00
rocky
39459168b0 More stringent "ifstmt" checks on 3.x 2020-01-16 14:02:04 -05:00
rocky
a532aa5b0e 3.7+ use attribute_w_parens like we do in pre 3.7 2020-01-16 11:43:29 -05:00
rocky
bad40eb63f Disable 3.6 test_sys.py until we can fix 2020-01-16 04:48:54 -05:00
rocky
172239f50b More accurate 3.6 "ifsmt" and "ifelsesmt" 2020-01-16 04:11:12 -05:00
rocky
e0f0741c8e Go over 2.6.9 runtests.sh 2020-01-15 21:49:22 -05:00
rocky
af1fe8f176 3.7 and 2.6 coexistance in handling jump targets 2020-01-15 21:38:53 -05:00
rocky
0677ddc8fb Constrain ifelsestmt on 2.6 more. 2020-01-15 21:32:39 -05:00
rocky
3fbe0b90e3 Fix typo bug introduced in refactoring. 2020-01-15 19:47:03 -05:00
rocky
546269271f go over POWER exclusion tests 2020-01-15 04:54:41 -05:00
rocky
968f86011b 3.6+ if/else in loops where jump offsets are "large" 2020-01-15 04:43:53 -05:00
rocky
5cdf057a47 Correct handling "if" in dictcomp in semantic actions for 3.x 2020-01-15 02:36:19 -05:00
rocky
3c2dafe74c Fix a 2.6 bug found in pyenvlib testing 2020-01-14 22:30:48 -05:00
rocky
585dcfb8ce Start allowing runtests for 3.7.x 2020-01-14 19:16:19 -05:00
rocky
84e9b75e78 Attempt to fix runtests.sh again 2020-01-14 18:51:40 -05:00
rocky
5f230fa177 Add 3.7 "testfalsel" for looping conditions 2020-01-14 18:41:39 -05:00
rocky
e2cbf5f4bd small tweak to last change 2020-01-14 13:03:24 -05:00
rocky
bb8c5ac5a0 Sync 3.7+ n_call code with decompyle6 2020-01-14 12:45:02 -05:00
rocky
cbd45a93ab Warn about byte type when decompiling Python3 from Python2 2020-01-14 12:07:42 -05:00
rocky
0706f18b1d 3.7 test_fstring now works. 2020-01-14 00:09:04 -05:00
rocky
73937ffeb4 Handle set/dictionary comprehensions in format strings 2020-01-13 23:49:17 -05:00
rocky
a918055a31 3.6+ nested format strings again 2020-01-13 21:25:20 -05:00
rocky
ec3a9978fc Better 3.6+ nested format strings 2020-01-13 19:08:54 -05:00
rocky
491f81902d File typo 2020-01-13 16:30:34 -05:00
rocky
0a63a66f55 runtests.sh remove 2.6.9 "fails on its own" tests 2020-01-13 16:02:05 -05:00
rocky
3540c951dc Merge branch 'master' into python-2.4 2020-01-13 12:56:51 -05:00
rocky
b8413d2c23 runtests 2.6 typo 2020-01-13 12:56:25 -05:00
rocky
4b46a8ffdf Small fixes 2020-01-13 11:41:53 -05:00
rocky
74961caed1 Merge branch 'master' into python-2.4 2020-01-13 11:25:59 -05:00
rocky
84fe813f0a Typo in last commit 2020-01-13 11:23:34 -05:00
rocky
7f2f3bd76c runtest.sh 2.6.9 exclusion tweak 2020-01-13 10:31:03 -05:00
rocky
c046aa3b9b runtest 3.6 tweak 2020-01-13 09:46:32 -05:00
rocky
d575e57e31 Runtests for 2.6 go tweak 2020-01-13 09:43:34 -05:00
rocky
02e0377ce1 Separate 2.6 files in runtests.sh 2020-01-13 09:31:39 -05:00
rocky
a5c987d853 See above 2020-01-13 09:16:08 -05:00
rocky
cbd8b6d458 Start clean up runtest.sh exclusions 2020-01-13 09:11:22 -05:00
rocky
54f4806021 More fstring bugs -- nested fstring grammar rules 2020-01-13 08:04:53 -05:00
rocky
de282af05d Fix some fstring formats bugs...
* Need parens around a lambda in an format string.
* handle format string specifier + width

Note: other format-string bugs remain.
2020-01-13 06:40:18 -05:00
rocky
f56ad56021 Wacky string at beginning of fn which is not docstring...
3.7.6 test_fstring.py tests this.
2020-01-12 22:59:06 -05:00
rocky
359672415b Merge branch 'master' into python-2.4 2020-01-12 22:04:14 -05:00
rocky
d8990c89ae Merge branch 'master' of github.com:rocky/python-uncompyle6 2020-01-12 22:03:55 -05:00
rocky
fe9a8c9dfe Go over 3.7 test failurs in runtests.sh 2020-01-12 22:03:47 -05:00
rocky
540fde898d See above 2020-01-12 12:43:48 -05:00
rocky
fd35f045b7 runtests again 2020-01-12 11:51:04 -05:00
rocky
4f0e8d8ab4 Runtests again 2020-01-12 11:38:15 -05:00
rocky
5b889bf4f3 Fix test_grammar.py for 2.4 2020-01-12 11:28:37 -05:00
rocky
7adfc9c2dc Merge branch 'master' into python-2.4 2020-01-12 10:23:52 -05:00
rocky
58d8e29905 runtests.sh again 2020-01-12 10:11:12 -05:00
rocky
b61170657c runtests again 2020-01-12 08:22:10 -05:00
rocky
2f1802873a Add timeout to runtests.sh 2020-01-12 07:28:13 -05:00
rocky
9f6138ccc0 See above 2020-01-12 06:18:32 -05:00
rocky
a4e114f64f runtests again. 2020-01-12 05:34:16 -05:00
rocky
52c5d07d95 Update runtests.sh 2020-01-12 05:17:46 -05:00
rocky
ac0b0ff7b6 DRY Python 2 reduction check code a little 2020-01-12 04:50:45 -05:00
rocky
316bf7f0e0 Go over runtests.sh again 2020-01-12 04:24:55 -05:00
rocky
258db3da20 Go over runtests.sh for a batch environments 2020-01-11 23:12:56 -05:00
rocky
8fda09459c tryelsestmtl3 needs more checks 2020-01-11 22:50:18 -05:00
rocky
021c5cad2a Ooops - stray debug left in 2020-01-11 22:37:40 -05:00
rocky
b84c89e817 Bang on getting 3.x "try" vs "try/else" disambiguated 2020-01-11 22:36:07 -05:00
rocky
aaba4ecb2b Better try/else/finally for 3.x 2020-01-11 21:33:22 -05:00
rocky
aaf8729772 See above 2020-01-11 20:48:28 -05:00
rocky
322c0f67bc One more 3.4 runtest exclusion for now 2020-01-11 20:18:16 -05:00
rocky
9c45794144 Update runtest stats 2020-01-11 20:04:16 -05:00
rocky
e6bade66c0 Typo in last commit 2020-01-11 19:33:40 -05:00
rocky
ccb8b81cc0 Go over runtests.sh for 3.5 again 2020-01-11 19:03:40 -05:00
rocky
56ec47f7ad Rutests.sh update for 3.5 2020-01-11 18:38:51 -05:00
rocky
651170db9a Revise run-and-email scripts. 2020-01-11 18:15:43 -05:00
rocky
9eda8926a3 Go over 3.4 runtest.sh failure list 2020-01-11 17:55:50 -05:00
rocky
89e7eaf695 Go over 3.3 runtests.sh 2020-01-11 12:28:31 -05:00
rocky
b1101311f0 go over 3.4 runtests.sh failure list 2020-01-11 12:05:06 -05:00
rocky
2949b55163 Update runtests for early 3.x 2020-01-11 11:26:30 -05:00
rocky
0ece75f8ae test_ast.py for 3.0..3.3 works now 2020-01-11 11:12:40 -05:00
rocky
7af6b6bc06 Fix 3.0..3.3 keyword-only parameters semantic actions 2020-01-11 11:06:59 -05:00
rocky
ff92ca8586 Update batch test limits...
for the code we have, not the code we would like to have
2020-01-11 10:44:09 -05:00
rocky
061da83863 3.7 "import" fix 2020-01-11 07:37:28 -05:00
rocky
c3d7ba6dad 3.7 "imports" and "or" 2020-01-11 07:23:23 -05:00
rocky
6cef42f6c7 3.7+ "or" disambiguation and assert2 handling 2020-01-10 20:44:28 -05:00
rocky
eba8f04e29 DRY reducecheck code 2020-01-10 15:36:24 -05:00
rocky
d1bc30e2f1 3.7 testtrue with asserts 2020-01-10 14:04:47 -05:00
rocky
fd2b551661 Forgot to add testtrue check 2020-01-10 10:29:24 -05:00
rocky
505946d747 Add "testtrue" reduction rule...
only for 3.7 for now.
2020-01-10 10:26:40 -05:00
rocky
07f16fa040 need to relax node checking on tryelsesmtl3...
now that except_handler_else is derived from except_handler.
2020-01-09 23:24:42 -05:00
rocky
5a3aaa9688 test_grammar again 2020-01-09 23:19:20 -05:00
rocky
69105825bd Administrivia: adjust python grammar check 2020-01-09 23:00:49 -05:00
rocky
ef437d191d 3.5 test_buffer now works 2020-01-09 22:39:35 -05:00
rocky
fedd5e0ba5 Better "try" vs. "try"/"else" disambiguation ...
via reduction check that was originally only in 2.7
2020-01-09 22:37:02 -05:00
rocky
7bcebf8656 Move some parse2 reduction rules into reducecheck 2020-01-09 21:24:04 -05:00
rocky
8b74d8f855 Fix bug in handling 3.5- complex annotation return...
Go over runtests.sh for 3.5
2020-01-09 19:55:22 -05:00
rocky
fee02e0aa0 Go over runtests.sh for 3.5 2020-01-09 18:56:10 -05:00
rocky
a99a4cead4 Go over runtests.sh for 3.6 2020-01-09 17:30:26 -05:00
rocky
d31478f56a Go over 3.6 runtest exceptions 2020-01-09 17:17:55 -05:00
rocky
788cd8dc80 Merge hell 2020-01-09 15:19:37 -05:00
rocky
508331e743 Merge hell 2020-01-09 15:19:00 -05:00
rocky
68c82f9d4e Merge branch 'master' of github.com:rocky/python-uncompyle6 2020-01-09 14:28:57 -05:00
rocky
e0e4aed591 More runtest exclusions 2020-01-09 14:28:35 -05:00
rocky
158b145394 Make runtests.sh more version robust 2020-01-09 12:58:27 -05:00
rocky
d1d9219d48 runtest exclusions 2020-01-09 09:16:03 -05:00
rocky
778c8d6003 Forgot to add this file. 2020-01-09 04:39:27 -05:00
rocky
5fc54015e4 3.7+ or reduction rule again 2020-01-09 04:32:15 -05:00
rocky
14f889561b 3.7+ multiple "and" parser generalize 2020-01-09 03:37:17 -05:00
rocky
7dee584a46 3.7+ "or" handling in listcomp 2020-01-09 03:15:30 -05:00
rocky
7c03cc466d More 2.7 compatibility 2020-01-09 01:35:50 -05:00
rocky
086ceaf176 More 2.7 compatibility 2020-01-09 01:34:41 -05:00
rocky
30d8830957 Fix 2.x compatibility 2020-01-09 01:32:15 -05:00
rocky
199fb532bf Move code from parse37base to reducechecks 2020-01-08 22:24:41 -05:00
rocky
b0d931b760 Small changes 2020-01-08 20:43:32 -05:00
rocky
6f6ef19e0a Start splitting out reduction checks 2020-01-08 20:25:59 -05:00
rocky
7b76d55e55 Start to fold in 3.7 reduction-rule goodness into 3.6 2020-01-08 19:50:05 -05:00
rocky
7d24910b3c "with .. as" with tuples need parens in 3.0 so always add (). 2020-01-08 12:02:34 -05:00
rocky
a98bc444f7 Remove long suffix "L" on ints in bytecode for > 3.0 2020-01-08 11:54:45 -05:00
rocky
13d9bcaaa9 Some reorg and Lame attempt to disasmbiguate "and" and "if .. if"...
More work is needed.
2020-01-08 10:31:19 -05:00
rocky
24f59546fe better output in batch testing 2020-01-07 21:14:35 -05:00
rocky
d8628e79fb 2.6 "if" vs "if/else" disambiguation via reduction rule. 2020-01-07 20:51:44 -05:00
rocky
c0a907f436 Variable name typo in run-and-email.sh 2020-01-07 18:13:30 -05:00
rocky
8afd9cdaf5 Limit run-and-email.sh for now 2020-01-07 15:57:48 -05:00
rocky
c65e5cde70 One more use of except_handler_else 2020-01-07 12:25:00 -05:00
rocky
95bc0f1fbc Update batch runtests.sh 2020-01-07 10:49:14 -05:00
rocky
eb3dac062d More Administrivia 2020-01-07 10:13:25 -05:00
rocky
65e3e5fe5b Update runtests.sh again 2020-01-07 06:25:49 -05:00
rocky
8c5873333f Reduce exceptions in runtest.sh for 2.7 2020-01-07 04:49:04 -05:00
rocky
9a77dfaf95 Use copysign() in 2.6 nuke -0.0 test if < 2.6 2020-01-07 04:39:34 -05:00
rocky
773bbdab0a Use copysign in 2.6 nuke -0.0 test if < 2.6 2020-01-07 04:37:28 -05:00
rocky
14468fe8c9 Go over 2.5 for reduction rules and tests 2020-01-06 23:34:18 -05:00
rocky
9df8dd7384 Go over 2.5 for reduction rules and tests 2020-01-06 23:32:36 -05:00
rocky
ae148d57e5 Merge branch 'master' into python-2.4 2020-01-06 23:32:31 -05:00
rocky
19cac525ee Accomodate "return" in an except handler 2020-01-06 18:57:05 -05:00
rocky
8e2c290e96 Disambiguate 2.7 "try" and "try/else"
will expand to other 2.x versions later
2020-01-06 18:29:10 -05:00
rocky
a3beccc874 Another case where we need code to set the generator bit..
via a dead-code "yield".
2020-01-06 17:22:50 -05:00
rocky
839eb6fe0b bogus "yield" insertion not needed in 2.x 2020-01-06 15:02:40 -05:00
rocky
078cca335a Seomtiems we need to add "yield"...
in order to get the generator bit flag set, such as in 3.x where the
yield is optimized away.
2020-01-06 14:57:11 -05:00
rocky
63a88b8eea Some Python 3.x lambda params are in reverse order 2020-01-06 10:54:14 -05:00
rocky
67c047df75 Python 2.4- doesn't have condition expresions 2020-01-06 04:43:52 -05:00
rocky
78c4db722a Python 2.4- doesn't have condition expresions 2020-01-06 04:42:23 -05:00
rocky
444bab760b Update runtests.sh exception list 2020-01-05 21:25:34 -05:00
rocky
eefe7bdb6b runtests.sh update 2020-01-05 21:24:21 -05:00
rocky
2e0c0f8245 What's up with test_generators.py 2020-01-05 21:17:28 -05:00
rocky
3c5ad58e25 Add 2.x if vs if/else reduction rule check 2020-01-05 21:07:24 -05:00
rocky
e07e2a498e 2.x if vs ifelse reduction-rule testing 2020-01-05 21:04:42 -05:00
rocky
962c503133 Small typo 2020-01-05 18:57:04 -05:00
rocky
4bf7e60bad Merge branch 'master' into python-2.4 2020-01-05 18:43:42 -05:00
rocky
4f545c5bfa Get ready for release 3.6.2 2020-01-05 18:40:07 -05:00
rocky
37b7a4b0b6 Merge hell 2020-01-05 18:07:13 -05:00
rocky
b842189d8a Merge branch 'master' into python-2.4 2020-01-05 18:06:57 -05:00
rocky
bbfdb814bf Fix 3.4+ keyword-only parameter handling 2020-01-05 15:54:31 -05:00
rocky
d088e7ef11 Better 3.x if/else reduction rule checking 2020-01-05 13:27:50 -05:00
rocky
6646d18c7a More complex complex test 2020-01-05 11:54:41 -05:00
rocky
716e097654 kwonly args in lambas for 3.3..3.5 2020-01-05 11:17:33 -05:00
rocky
dba95c5200 3.7+ imports yet again 2020-01-05 00:13:53 -05:00
rocky
d5df411c7a 3.7+ multiple imports of dotted path 2020-01-03 23:22:28 -05:00
rocky
077f192711 Improve 3.7+ dotted imports 2020-01-03 21:22:55 -05:00
rocky
498df35a6c Update runtests.sh failures for 3.7 2020-01-03 09:31:11 -05:00
R. Bernstein
7e71ce3260 Merge pull request #301 from rocky/decompyle6-2020-merge
Decompyle6 2020 merge
2020-01-03 09:06:39 -05:00
rocky
825add1af7 3.7+ "if not" in list comprehension and other bug fixes 2020-01-03 09:01:48 -05:00
rocky
1a901bde8f remove unused rule found by grammar check. 2020-01-03 01:02:31 -05:00
rocky
732b5165c2 Fix a 3.7+ chained compare bug...
others remain though.
2020-01-03 00:55:45 -05:00
rocky
7bd81efe9b 3.7+ "from import" vs "import as" disambiguation 2020-01-02 09:43:37 -05:00
rocky
c42e16fafe Fix 3.7+ import as 2020-01-01 22:59:07 -05:00
rocky
6de57249ed Start 3.6+ var type annotations and decompyle3 merge...
Although overall an improvement, some new breakage
has occurred and should be fixed.
2020-01-01 01:42:00 -05:00
rocky
faf6ea9630 imports for 3.7+ again 2019-12-29 01:28:05 -05:00
rocky
566143b515 Python 3.7+ optimized if in comprehension 2019-12-28 18:09:00 -05:00
rocky
b2e1edb434 Fix Python 3.7+ "import as" but keep "import from" working 2019-12-28 11:09:31 -05:00
rocky
62c249d6b2 Simplify make_function3 by customization
We now have different routines for 3.6+
(and 2.x from before).

This is desirable before fixing 3.0..3.5 lambdas with default
paramerts and * args.
2019-12-27 13:02:59 -05:00
rocky
db2fdb30fd Tidy code.
* Don't use "str" as a variable name
* blacken helper and alphabetically order fns
* use helper function `find_code_node()` in transform `mk_func()`
2019-12-27 12:38:09 -05:00
rocky
37301ab49e Was dropping docstrings! Add in decompyle make_function36 2019-12-27 11:41:03 -05:00
rocky
97e3a7eb02 Split out make_function.py into v2 and v3 versions
A custom 3.3 make_function will be coming soon.
2019-12-27 03:32:15 -05:00
rocky
f98f7372c3 Administrivia 2019-12-24 12:52:32 -05:00
rocky
2f9284c3a0 Administrative change 2019-12-24 12:50:44 -05:00
rocky
49a65f9454 Merge branch 'master' into python-2.4 2019-12-24 12:47:58 -05:00
rocky
f88df747b8 Administrivial typo 2019-12-24 12:47:07 -05:00
rocky
6be3656ceb Get ready for release 3.6.1 2019-12-24 12:42:05 -05:00
rocky
72526dc806 Merge branch 'master' into python-2.4 2019-12-23 20:51:43 -05:00
rocky
8b48f62fc8 lambda *args with kwargs in 3.4 and 3.5 2019-12-23 20:51:03 -05:00
rocky
868721595d Fix grammar rule for "expr GET_ITER" in 3.1+ 2019-12-23 11:52:27 -05:00
rocky
747ec0d0bc "make check-short" now works 2019-12-23 11:11:07 -05:00
rocky
a3932c7aec Merge branch 'master' into python-2.4 2019-12-23 11:11:00 -05:00
rocky
9f270dce4a Go over full-version testing
When all versions, do less, but do the run tests. Overall overall
better.

Get rid of the tests that were the most problematic with hypothesis.
Hypothesis just doesn't run on enough versions and needs specific
versions for things we do use
2019-12-23 10:46:33 -05:00
rocky
bffbd0b352 3.6+ lambda params; add semantic rule customizing for lambdas 2019-12-23 07:19:40 -05:00
rocky
50fbea1a06 Python lambda *arg handling 2019-12-23 05:33:20 -05:00
rocky
ddffc2c078 blacken main.py 2019-12-23 04:44:40 -05:00
rocky
d9318e9bed Fix up better_repr tuple and list for singletions 2019-12-22 21:22:55 -05:00
rocky
c078048fb0 Fixes in 3.5+ lambdas break 3.3-. Deal with later. 2019-12-22 13:31:49 -05:00
rocky
6a82b1045e 3.x lambda * handling 2019-12-22 12:28:27 -05:00
rocky
3ea73cf977 Update list of stdlib failed tests 2019-12-22 09:05:40 -05:00
rocky
f3bec73840 Fix Bug in 3.6+ in call_ex_kw4 and call_kw36 2019-12-22 08:49:12 -05:00
rocky
8f4343ef22 Fix bug 3.5+ in handling nested decorators 2019-12-21 22:57:59 -05:00
rocky
d50834193c Update instructions 2019-12-20 10:36:01 -05:00
rocky
fa7ff89a32 Forgot to add this file in last commit 2019-12-19 06:50:01 -05:00
rocky
28d9e66a53 Redo the way we handle complex literals and 3.7+ bug fixes...
In 3.7+ remove assert_expr* parser rules
Fix "call" precidence in 3.7+ for it children
2019-12-19 06:40:13 -05:00
rocky
e39c6c7f0a Fix "with as" indenting and decorated "async def"
Misc other improvements: make check-short now is short
2019-12-18 09:14:09 -05:00
rocky
c683f3a88d Merge branch 'master' into python-2.4 2019-12-17 18:28:22 -05:00
rocky
8470bded59 Bugs found in test_complex.py
list comprehensions from 3.x closures didn't handle nested for's
before 3.6.

Handle nanj and infj.
2019-12-17 18:27:43 -05:00
rocky
01b2b46757 Handle named parameters in 3.0..3.3 lambdas
What a pain. Thank you, Python!
2019-12-17 09:36:10 -05:00
rocky
aa398423a3 Add stripped-down test for lambda star bug 2019-12-16 16:42:11 -05:00
rocky
41bcf3387d Start to go add runtests exclusions for 3.3 2019-12-16 16:36:25 -05:00
rocky
89e7a0a246 ASYNC_GENERATOR -> 3.5+ "async def" 2019-12-16 13:44:33 -05:00
rocky
a1d0ee9694 Merge branch 'master' into python-2.4 2019-12-16 13:37:43 -05:00
rocky
179fcafaba Fix indentation format in "async for" 2019-12-16 13:36:46 -05:00
rocky
e56a3c86d5 CircleCI woes 2019-12-16 14:25:46 -05:00
rocky
f527fdbdcd Bump xdis version to handle 3.6 code optimization flags 2019-12-16 13:47:55 -05:00
rocky
d39169dbda Add 3.7 async listcomp 2019-12-16 00:14:16 -05:00
rocky
bee7bea330 Merge branch 'master' into python-2.4 2019-12-15 21:19:08 -05:00
rocky
996719688a Merge branch 'master' of github.com:rocky/python-uncompyle6 2019-12-15 21:18:44 -05:00
rocky
af9f6b05fa Add 3.7 "async for" in generator 2019-12-15 21:18:37 -05:00
rocky
39cbddccaf Include test for recent bug 2019-12-15 11:13:57 -05:00
rocky
75b3aaa86d Adminsitrivia: improve setup scripts 2019-12-15 10:56:29 -05:00
rocky
e82a37528d Administrivia: improve setup scripts 2019-12-15 10:54:42 -05:00
rocky
93b31a2fa4 Merge branch 'master' into python-2.4 2019-12-15 10:51:34 -05:00
rocky
e93b70bcce Fix Python 3.x pringing superclasses...
class Description: not class Description("Description").
Introduced in not catching LOAD_CONST->LOAD_STR change
2019-12-15 10:49:24 -05:00
rocky
0eaeb82d48 Sync a little with decompyle3 2019-12-15 08:07:02 -05:00
rocky
0ae9612c7c Go over runtests.sh to make it more robust 2019-12-15 07:43:07 -05:00
rocky
59124c913f Merge branch 'master' into python-2.4 2019-12-14 21:33:11 -05:00
rocky
09f232700e Remove duplicate 3.8async rules 2019-12-14 21:32:00 -05:00
rocky
bfde66c5e1 Extend "and" reduction-rule test to 2.4 2019-12-14 19:49:26 -05:00
rocky
de4a15a5b3 Extend "and" reduction test to Python 2.4 2019-12-14 19:48:33 -05:00
rocky
4773ca4e5b Go over runtests.sh tests 2019-12-14 18:15:34 -05:00
rocky
1f1a734598 Update runtest.sh tests that fail 2019-12-14 18:11:32 -05:00
rocky
96270b34d0 Merge branch 'master' into python-2.4 2019-12-14 18:05:28 -05:00
rocky
62a3fcc9d5 Update runtests.sh output 2019-12-14 18:05:09 -05:00
rocky
bc7d7ddf12 Narrow what's excepted for iflastsmtl...
Disallow "if" jump to jump inside body of "then".
2019-12-14 17:23:37 -05:00
rocky
41b6e91286 More stringent transform test for assert 2019-12-14 11:31:13 -05:00
rocky
bc21e3163f Merge branch 'master' into python-2.4 2019-12-14 11:03:51 -05:00
rocky
56bf3e3125 unary_expr -> unary_op 2019-12-14 10:57:19 -05:00
rocky
805ec7dbfc Add "if_not_and" rule similar to "if_not_or" rule. 2019-12-13 05:15:21 -05:00
rocky
668141662e unary_expr -> unary_op to match Python AST
former unary_op is now unary_operator
2019-12-11 15:47:46 -05:00
rocky
cc55fa1de1 binary_expr -> bin_op to match Python AST
I know binary_expr is more natural, but as with things Python we
sometimes sacrifice elegance and clarity for Python Fascism.
2019-12-11 13:35:21 -05:00
rocky
6f51f8910c Add 3.7+ "and" grammar rule and limit "or" more 2019-12-11 12:32:32 -05:00
rocky
bc614cf3fb Another 3.7+ "or" grammar rule 2019-12-11 07:32:35 -05:00
rocky
05f3dad32c Fix some 3.7+ "if"/"and" logic bugs 2019-12-11 06:56:43 -05:00
rocky
fb3761e4f3 Add another 3.8 try/finally rule and semantic action 2019-12-10 22:28:16 -05:00
rocky
ab4a998867 Merge hell 2019-12-10 16:13:46 -05:00
rocky
9b2e22cbaf Small "not" bug in prior commit 2019-12-10 16:12:01 -05:00
rocky
cea2c7e1dc One more "assert" transform 2019-12-10 15:46:26 -05:00
rocky
79c38441b5 Better "assert" transformation. More 3.8 tests 2019-12-10 10:43:01 -05:00
rocky
efac5268a4 Merge branch 'master' into python-2.4 2019-12-09 22:05:20 -05:00
rocky
3e3dd87c3b Get ready for release 3.6.0 2019-12-09 21:51:15 -05:00
rocky
edbbefb57d Start to remove crud in control-flow detection for 3.7+ 2019-12-09 18:28:57 -05:00
rocky
ddaa7ef337 Fix 2.x false tryelsestmtl detection...
reinstate lots of stdlib tests which are fixed by this change.
2019-12-09 16:29:43 -05:00
rocky
6546bbdaf9 Fix 2.x false tryelsestmtl detection...
With grammar reduction tests. Same as tryelsestmt. Lots of stdlib tests work
now. (More remain though.)
2019-12-09 16:19:10 -05:00
rocky
825ed3fef9 Reinstate some stdlib tests...
now that we distinguish try/else a little better
2019-12-09 14:13:30 -05:00
rocky
120bdaedb9 Bump xdis version 2019-12-09 14:08:02 -05:00
rocky
7d9c4ce8ca Better try/else detection 2019-12-09 14:04:57 -05:00
rocky
a73ca4bf18 Start better try/else detection 2019-12-09 14:03:52 -05:00
rocky
fdac1e3c46 Use 3.9-enabled xdis 2019-12-09 12:56:30 -05:00
rocky
daab1e8610 Start to tolerate 3.9 (in pydisassemble) 2019-12-09 12:20:00 -05:00
rocky
b8f4dca505 Update README.rsgt 2019-12-09 07:19:51 -05:00
rocky
99b8a99ffa Python 2.5 fixes..
* "with" handling.
* Go over 2.5 runtest.sh exclusions
2019-12-09 06:57:02 -05:00
rocky
1c8f885629 2.5 bugs...
Handling "with"
Go over 2.5 runtests.sh exclusions
2019-12-09 06:53:40 -05:00
rocky
dfac71e092 Exclude one more test for time..
This saves CircleCI 40 seconds in elapsed time
2019-12-09 06:06:20 -05:00
rocky
827bd32a67 was not handling 2.4 "if not"...
As the late Danny Gumport used to say: "not"'s can turn you into
knots.

Also go over 2.4 runtest failures
2019-12-09 05:57:50 -05:00
rocky
34957487f0 Merge branch 'python-2.4' of github.com:rocky/python-uncompyle6 into python-2.4 2019-12-09 04:31:01 -05:00
rocky
1c943a465a CircleCI/PIP woes with Python 2.4 2019-12-09 04:30:41 -05:00
rocky
c77d9233f0 CircleCI/PIP woes with Python 2.4 2019-12-09 04:27:22 -05:00
rocky
8c879c02de Small logic correction in run-time test. 2019-12-09 04:09:44 -05:00
rocky
8cbdaecfc9 Merge hell 2019-12-09 04:06:34 -05:00
rocky
9bde5c6cac Merge branch 'master' into python-2.4 2019-12-09 03:29:55 -05:00
rocky
d11a9ea126 Remember rocky: use off2int() in offset testing! 2019-12-08 21:42:49 -05:00
rocky
4926474efc Add jump range check for 2.7 assert_expr_and 2019-12-08 21:37:45 -05:00
rocky
eba5226a04 Typos: decompyle3 -> uncompyle6 2019-12-08 18:05:37 -05:00
R. Bernstein
8d0ff367d8 Merge pull request #297 from rocky/decompile-merge
Merging in recent 3.7 and 3.8 improvements from decompyle6
2019-12-08 18:01:38 -05:00
rocky
c6ddefcef5 Merging in recent 3.7 and 3.8 improvements from decompyle6
This rebases 3.7, 3.8 ...decompilation off of 3.7ish rather than a 3.4
base.

Add more 3.7 and 3.8 tests
2019-12-08 17:54:59 -05:00
rocky
301464d646 Accomodate for optional docstring in function kw calculation 2019-12-02 12:58:26 -05:00
rocky
d5b52d44e0 Better bytecode detection for Python > 3.0...
Not perfect though. More work is needed on the xdis side.
2019-11-21 19:39:57 -05:00
rocky
322f491c83 Revise NEWS 2019-11-20 10:08:20 -05:00
rocky
2987d6a72b Go over some 3.0 and 3.1 tests 2019-11-18 22:46:27 -05:00
rocky
7609165967 Revise mixed expressions 2019-11-18 18:22:16 -05:00
rocky
ecf6de26a0 Add operator tests 2019-11-18 18:20:31 -05:00
rocky
495a969ccf Merge branch 'master' into python-2.4 2019-11-18 18:15:51 -05:00
rocky
655162a05e One more test 2019-11-18 18:15:30 -05:00
rocky
ca7f483dbb Better test coverage of operators (in 2.7 and 3.0) 2019-11-18 18:10:58 -05:00
rocky
e713169bdf Administrivia: go over tests...
Some tests were deferred and are not now
update Python 2.7 standard library tests
2019-11-18 12:30:48 -05:00
rocky
cc856e2b95 Refine 2.7 control flow reduction tests...
for "iflastsmtl" and "and"
2019-11-18 11:34:06 -05:00
rocky
d696443eb2 More 2.7 reduction checks for conditionals:
Specficially for "and" and "laststmtl"
2019-11-18 08:36:28 -05:00
rocky
a5e7eb19c6 Reinstate some tests 2019-11-18 06:59:27 -05:00
rocky
6659fffc0d Two Bugs ...
2.7: more stringent comparison and comp_if testing
2.6-2.7: fix botched dict constant translation
2019-11-18 06:49:36 -05:00
rocky
1868b566a1 RsT markup 2019-11-17 20:47:40 -05:00
rocky
791274c45d RsT markup 2019-11-17 20:47:13 -05:00
rocky
4327ee98e6 Update README for the current situation 2019-11-17 20:45:37 -05:00
rocky
2717a5e302 Administrivia 2019-11-17 20:26:35 -05:00
rocky
77dd3b8d50 Administrivia 2019-11-17 20:25:14 -05:00
rocky
1dafe0bd6a Merge branch 'master' into python-2.4 2019-11-17 20:18:57 -05:00
rocky
2cfc60fbd7 Get ready for release 3.5.1 2019-11-17 19:59:26 -05:00
rocky
daa424cf0c Some grammar cleanup based on coverage info 2019-11-17 01:01:52 -05:00
rocky
7b68c9c838 Administriva - bump testing versions 2019-11-16 22:54:32 -05:00
rocky
2c33a06535 Merge branch 'master' into python-2.4 2019-11-16 18:01:23 -05:00
rocky
df5df9364c Grammar debugging for 3.0, 3.7 and 3.8 2019-11-16 17:59:30 -05:00
rocky
f1496cad4d 3.0 return_if_stmt and...
* Some grammar cleanup
* add more grammar debugging
2019-11-16 17:32:48 -05:00
rocky
a3a15414d3 Add 3.0 whileTrue rule for recent CONTINUE change 2019-11-16 16:18:39 -05:00
rocky
9874553fb4 while1 rule adjustment for 3.0 2019-11-16 16:04:16 -05:00
rocky
d21d93fd84 Handle 3.0 call_stmt better 2019-11-16 15:21:59 -05:00
rocky
dbf2729f76 expand 3.0 "continue" detection 2019-11-16 12:23:09 -05:00
rocky
047e27c966 3.0 assert2...
Not like other 3.x due to the lack of POP_JUMP_IF
2019-11-16 09:10:14 -05:00
rocky
6a81a752a7 Adjust 3.0 iflastsmtl rule 2019-11-16 00:59:58 -05:00
rocky
44f0ba0efb Add 3.0 try/except rule 2019-11-15 23:39:36 -05:00
rocky
bc8907e752 Guard again improper assert transform...
we see this happen in getheader() from 3.0.1/lib/python3.0/http/client.pyc
2019-11-15 22:19:17 -05:00
rocky
4e9d8783d1 Add Python 3.0.1 list_comp rule 2019-11-15 21:32:31 -05:00
rocky
47c847644e Modify 3.0 _ifstmts_jump rule 2019-11-15 19:23:08 -05:00
rocky
af2ed31871 Add 3.0 whilestmt rule 2019-11-15 15:14:33 -05:00
rocky
49de5b5c9d add 3.0 iflaststmt rule 2019-11-15 14:07:37 -05:00
rocky
c8252ca9cb 3.0 import_from rule 2019-11-15 09:27:47 -05:00
rocky
0441fbc616 3.0.1 "ret_or", "ret_and", and "or" rules 2019-11-15 09:12:53 -05:00
rocky
1b4335edf1 Add 3.0.1 while loop rule 2019-11-15 07:48:23 -05:00
rocky
2e36551c02 Remove more 3.0 parse errors...
However this doesn't mean that some wrong rules still don't
kid in. We still have control-flow "if/and/else" vs "if/if/else" problems.
2019-11-14 18:32:52 -05:00
rocky
fff6f82dd7 expand 3.0 jump_except rule 2019-11-14 10:11:28 -05:00
rocky
7c8f3cc9ec Two 3.0 rules ...
- ifstmtlastl
- ifnotstmt30
2019-11-14 03:57:41 -05:00
rocky
78a595c8cf Bang on 3.0.1 control flow...
more word is needed though
2019-11-13 20:35:44 -05:00
rocky
cda0154594 Pypy 3.6.9 tolerance 2019-11-12 23:33:36 -05:00
rocky
d852f23962 3.3 "yield from" semantic action fix 2019-11-12 17:48:16 -05:00
rocky
065fd13b81 Small tweaks 2019-11-12 17:04:35 -05:00
rocky
659f37585b Bug in 3.0 rule in "jump_absolute_else" ...
and disallowing "else" to the wrong place.
2019-11-12 16:31:43 -05:00
rocky
bc18fcf7fa 3.0 tweak in iflastsmtl reduction validation 2019-11-12 06:37:43 -05:00
rocky
144f52da8e More 3.0 control flow pattern fixups 2019-11-12 06:08:30 -05:00
rocky
9f250b49ee Cope more JUMP/POP_IF not being in 3.0...
more is probably needed though.
2019-11-11 19:58:35 -05:00
rocky
4abdffecb9 More 3.0 control-flow rules...
Much more is needed though
2019-11-11 19:07:58 -05:00
rocky
1419acf019 More Python 3.0 for JUMP elimination ...
here, in except blocks.
2019-11-11 13:50:48 -05:00
rocky
bdc24d7f51 Add 3.0 gen_comp_body rule. 2019-11-11 05:10:54 -05:00
rocky
07ec8fa1fb More Python 3.0 custom "if" statment handling. 2019-11-10 18:44:43 -05:00
rocky
04c2240d63 Python 3.0 if/else handling 2019-11-10 17:23:33 -05:00
rocky
96dcdfd744 Last change but closer... 2019-11-10 16:09:17 -05:00
rocky
82ea77c592 Python 3.0 bytecode decoding 2019-11-10 15:56:04 -05:00
rocky
4f0e580438 Update testenv pypy 3.6 2019-11-10 13:44:52 -05:00
rocky
efd8fe54b2 Merge branch 'master' into python-2.4 2019-11-10 13:37:14 -05:00
rocky
09cc0d775a Pypy 3.3 tolerance and ...
Remove some duplicate grammar rules
2019-11-10 13:34:51 -05:00
rocky
d3acbe2641 Merge hell 2019-11-10 12:16:57 -05:00
rocky
5b0f772dc7 Merge branch 'master' into python-2.4 2019-11-10 12:16:04 -05:00
rocky
2da5a5649f Python 3.5 tolerance 2019-11-10 12:04:21 -05:00
rocky
373916f57c Pypy 3.5 tolerance 2019-11-09 21:56:36 -05:00
rocky
1c0c54991e Backend some buffers 2019-11-09 18:49:40 -05:00
rocky
5de5d2357f Update test_grammar for Python 3.8 2019-11-09 17:55:58 -05:00
rocky
6d296f11c9 Add another 3.8 test 2019-10-31 07:13:41 -04:00
rocky
0ae4acff9e Remove extraneous iter() in "for" of list comp...
Fixes #272
2019-10-30 21:58:14 -04:00
rocky
40c2f2962c Try expanding 3.8 testing 2019-10-30 19:36:42 -04:00
rocky
dae195e36e Expand 3.8 testing 2019-10-30 19:11:19 -04:00
rocky
2c503d5a14 Bump xdis ...
to handle pypy3.6 from Python 2
2019-10-30 11:58:39 -04:00
rocky
eed4c1025b Pypy 3.6 tolerance 2019-10-30 11:44:04 -04:00
rocky
86c1d12e69 Pypy 3.6 tolerance 2019-10-29 18:12:06 -04:00
rocky
61a367b0ae Don't test 3.8 except on 3.8 for now 2019-10-29 13:46:04 -04:00
rocky
dba6d24361 3.8 for block without a POP_BLOCK ...
and confusing JUMP_BACK for CONTINUE. Expect more like this.

Fixes #293
2019-10-29 13:32:43 -04:00
R. Bernstein
0b111f1568 Merge pull request #263 from rocky/pypy3.6
pypy3.6 handling
2019-10-29 12:55:30 -04:00
rocky
c666e2dc3d Remove pypy 3.6 testing for now 2019-10-29 12:08:00 -04:00
rocky
0a5fcc51d8 Pypy 3.6 fixes and tests 2019-10-29 11:43:09 -04:00
rocky
ade9f7a182 Add Pypy 3.6 file for showing unmarshal problem 2019-10-28 20:58:42 -04:00
rocky
d41ef3e5dc Pypy 3.6 tolerance 2019-10-28 14:46:45 -04:00
rocky
ebb0342b38 WIP pypy3.6 handling 2019-10-28 13:20:51 -04:00
rocky
f17ebf42a9 Administrative kinds of changes 2019-10-28 13:17:10 -04:00
rocky
85dcce4ff2 Add twine check in release process 2019-10-19 12:33:29 -04:00
rocky
bc9a16eaac Correct version number in NEWS.md 2019-10-12 20:10:29 -04:00
rocky
93e26c7326 Fragment merge hell 2019-10-12 20:08:12 -04:00
rocky
914369bd36 Merge branch 'master' into python-2.4 2019-10-12 20:06:04 -04:00
rocky
d08d183fc8 bytecode 1.6 test omission 2019-10-12 19:58:01 -04:00
rocky
0b3d6b8add Get ready for release 3.5.0 2019-10-12 19:53:17 -04:00
rocky
5cb46c2ed3 Better simpler fragment fix...
remove hide_internal test. We changed the default and that's what
whas causing RETURN_LAST to not get included.
2019-10-12 17:55:52 -04:00
rocky
163e47fb49 Fragment fixes (and workarounds)
fragments.py: add more parent offsets. blacken buffer
parser3.py: additional grammar rules for fragment parser

Misc small typos and corrections
2019-10-12 12:22:27 -04:00
rocky
0cf32f1b70 Better 1.5 parameter tuple handling...
Tidy README.rst
2019-10-10 17:20:00 -04:00
rocky
fcc4aff62c Try to fix up README.RsT 2019-10-02 14:10:13 -04:00
rocky
a6e2074606 Merge branch 'master' into python-2.4 2019-10-02 13:53:24 -04:00
rocky
f0f9676f52 update news 2019-10-02 13:50:02 -04:00
rocky
be610aa6b3 Bump min xdis version...
And testing versions
2019-10-02 13:46:56 -04:00
rocky
1494bb2049 Bump test python versions 2019-10-02 10:59:59 -04:00
rocky
44382ec78e Merge branch 'master' into python-2.4 2019-10-02 10:51:01 -04:00
rocky
d62dc3daac Get ready for release 3.4.1 2019-10-02 10:45:01 -04:00
rocky
592aba9dd8 Merge branch 'master' into python-2.4 2019-10-02 10:35:39 -04:00
rocky
5ad51707e3 Wasn't handling 3-arg %p in fragments.py...
and also fielding errors in code_deparse()
2019-10-02 10:29:49 -04:00
rocky
f28c255804 Add downloads per month 2019-09-25 16:00:57 -04:00
rocky
315965300f Note assert{,2}not is transformation only 2019-09-23 08:32:46 -04:00
rocky
9bd85fe5a0 Correct assert{,2} transforms
Fixes #289
2019-09-23 08:26:16 -04:00
rocky
c6e3168c31 Update an old not-every-used config 2019-08-24 09:26:41 -04:00
rocky
2fb9b8f64d Remove 2.6.9 form older version. (Is newer?) 2019-08-24 08:39:04 -04:00
rocky
d8d52d5181 Merge branch 'python-2.4' of github.com:rocky/python-uncompyle6 into python-2.4 2019-08-24 08:33:07 -04:00
rocky
94c01d395a Merge branch 'master' into python-2.4 2019-08-24 08:32:21 -04:00
rocky
9bced5d2c9 Merge branch 'master' into python-2.4 2019-08-24 08:29:03 -04:00
rocky
7969b19c2b Reinstate Generator rule accidentally removed...
I removed the rule when writing how issue #283 was fixed. What was
supposed to be a temporary change, I accidentally committed.
2019-08-24 08:05:50 -04:00
rocky
f8bfde4a8e Get ready for release 3.4.0 2019-08-24 07:58:42 -04:00
R. Bernstein
e2b309fa30 Merge pull request #286 from rocky/tree-transform
Add tree transformation phase...
2019-08-24 06:58:40 -04:00
rocky
1ebfde6927 Add tree transformation phase...
if ... else if ... ->  if ... elif ..
if .. : raise AsssertionError ->  assert

Add options --tree=before --tree=after  -T expanded to include this

This code ported from decompyle3. x0ret did all the heavy lifting.
2019-08-21 09:00:09 -04:00
rocky
73619de3f5 CircleCI 4th try 2019-08-21 08:57:29 -04:00
rocky
600cd0b8ee CircleCi 3rd try 2019-08-21 08:55:35 -04:00
rocky
90a2ed2c9e CircleCI 2nd try 2019-08-21 08:50:38 -04:00
rocky
8728cb6a99 Fix for recent CircleCI breakage 2019-08-21 08:43:38 -04:00
rocky
8daedaf063 Run black over validate.py 2019-08-20 18:23:52 -04:00
rocky
4a4a20995e Update runtests.sh...
for 2.6 and 2.7. More work is needed. Start count of skipped tests.
2019-08-12 11:24:07 -04:00
rocky
c923ce9afe Tweak runtests.sh so it works on 2.6 2019-08-11 22:00:28 -04:00
rocky
fd7caf7f3f Tweak runtests so it works on 2.6 2019-08-11 21:58:57 -04:00
rocky
e2d7fd5f09 Merge branch 'master' into python-2.4 2019-08-11 21:37:10 -04:00
R. Bernstein
88901c6901 Merge pull request #285 from trengri/master
Test case for #284
2019-08-11 19:45:22 -04:00
Grigory Trenin
31f7d14eab Test case for #284 2019-08-12 02:09:51 +03:00
rocky
e29e979fbf Merge branch 'master' into python-2.4 2019-08-10 20:40:01 -04:00
rocky
388d1da970 Fixes #284 2nd problem...
while 1 bug for 2.6
2019-08-10 20:39:02 -04:00
rocky
729fdc9c8d Merge branch 'master' into python-2.4 2019-08-10 18:47:38 -04:00
rocky
66294d54f7 Comment what's up in last change. 2019-08-10 18:46:56 -04:00
rocky
55783c2712 Fixes #284 2019-08-08 21:48:12 -04:00
rocky
0574f5302c Merge branch 'master' into python-2.4 2019-08-05 10:37:29 -04:00
rocky
fd580f3c60 Python 2.6 generator rule with 'and' conditional
Fixes #283.
2019-08-05 10:36:08 -04:00
rocky
a781006ff1 Need spark version 1.8.9 for Python 3.7.4 2019-07-28 21:11:17 -04:00
rocky
0be3d5a530 Bump min spark-parser version
spark-parser 1.8.8 handles Python 3.7.4 and 3.8.

Fixes #281
2019-07-28 20:49:37 -04:00
rocky
595ac95f32 Merge branch 'master' into python-2.4 2019-07-25 07:50:02 -04:00
rocky
bc3cd0102b Use updated python 3.8 from xdis 2019-07-25 07:44:49 -04:00
rocky
6e6d590268 Reformat (via black) make_function.py 2019-07-18 11:01:47 -04:00
rocky
ed92f03bed Merge branch 'master' into python-2.4 2019-07-18 05:30:46 -04:00
rocky
71bdc8dc6a Merge branch 'master' of github.com:rocky/python-uncompyle6 2019-07-18 05:27:05 -04:00
rocky
71735ca7ef Note that CALL_METHOD is used in 3.7+
and not just Pypy anymore
2019-07-18 05:26:33 -04:00
R. Bernstein
9f121ef00c Merge pull request #279 from rocky/build-list-unpack
Fix issue in BUILD_LIST_UNPACK and variants
2019-07-13 17:54:48 -04:00
x0ret
2e01f42f65 Fixes #278 2019-07-14 01:12:42 +04:30
rocky
3f9a862277 Remove dup semantic rule 2019-07-05 06:24:14 -04:00
rocky
cc531cf90a Fix call to code_deparse call in deparse_code2str
Fixes #275
2019-07-05 06:06:14 -04:00
rocky
43b1981244 Except for 2.4 2019-07-04 10:24:08 -04:00
rocky
cb5d4f4989 Merge branch 'master' into python-2.4 2019-07-04 10:23:41 -04:00
rocky
0639fdbbb7 Merge branch 'python-2.4' of github.com:rocky/python-uncompyle6 into python-2.4 2019-07-04 10:02:18 -04:00
rocky
c7124ad9ca RsT :code: before backticks 2019-07-04 10:01:36 -04:00
rocky
44a4aab0a7 Use black to reformat some files 2019-07-04 09:56:50 -04:00
rocky
2a52982d52 Go over NEWS for markdown and spelling 2019-07-04 05:15:56 -04:00
R. Bernstein
56e5e8dcef Add repology package status 2019-07-04 04:25:24 -04:00
rocky
ecab7d7b09 Python 2.4 unpack rule needs adjusting for exceptions 2019-07-03 20:08:23 -04:00
rocky
e56088b566 Need parens in unpack in 2.4ish 2019-07-03 20:04:45 -04:00
rocky
40d2ef3071 Merge branch 'master' into python-2.4 2019-07-03 19:38:47 -04:00
rocky
e39a902e56 Get ready for release 3.3.5 2019-07-03 19:37:29 -04:00
rocky
e2914ed552 More excpet_cond futzing 2019-07-03 19:26:36 -04:00
rocky
5afa14a945 More except_cond futzing 2019-07-03 19:23:23 -04:00
rocky
4f5ad533c3 Reinstate except_cond{2,3} rules 2019-07-03 19:21:39 -04:00
rocky
f425db33b7 except_cond3 needs to be in 2.x 2019-07-03 19:16:09 -04:00
rocky
7f7487206a Reinstate except_cond{2,3} rules 2019-07-03 18:59:24 -04:00
rocky
82d8e0cd47 master merge hell 2019-07-03 18:36:53 -04:00
rocky
1c21e1c9d2 Merge branch 'master' into python-2.4 2019-07-03 18:35:11 -04:00
rocky
68c5b2338f Clearer 3.3 "yeild_from" semantic handling 2019-07-01 12:54:38 -04:00
rocky
e55a0410c9 weak-verify -> syntax-verify. More bytecode tests 2019-07-01 10:23:43 -04:00
R. Bernstein
0fe8961418 Merge pull request #269 from rocky/if-elif-else-more
If elif else more
2019-07-01 09:52:11 -04:00
R. Bernstein
8cd331a32b Merge pull request #273 from rocky/py3-annotation-args
Fix handling py3 annotation args + defparam comma issue
2019-06-30 18:54:58 -04:00
rocky
4c76931807 Update tests related to branch 2019-06-30 18:20:40 -04:00
x0ret
7b7f794913 Fix handling py3 annotation args + defparam comma issue 2019-07-01 01:28:32 +04:30
rocky
50e46531ce Adjust 3.x grammar rules to include annotate args 2019-06-29 23:33:21 -04:00
rocky
cd2072b8e3 Merge branch 'master' into python-2.4 2019-06-29 15:57:22 -04:00
R. Bernstein
67ef34977f Merge pull request #270 from rocky/py3-star-args
Fix issue in 3.x star args function signatures
2019-06-29 15:57:02 -04:00
rocky
32c7b8f23d Add tests for x0ret's recent varrg fixes 2019-06-29 15:50:47 -04:00
x0ret
2f06d1eeb0 Fix issue in 3.x star args function signatures 2019-06-29 21:53:02 +04:30
rocky
999f1fb0f9 Mostly x0ret's while(1)/if fixes ..
plus a potential test
2019-06-29 07:01:45 -04:00
x0ret
76eef9a149 Handle if elif else case for 3.5 2019-06-29 06:57:23 -04:00
rocky
c8b945fb56 Handling if elif else more 2019-06-29 06:57:23 -04:00
rocky
a1e7c16dbe Fix bugs introduced by last commit 2019-06-29 06:19:02 -04:00
rocky
35f14e4357 Small assert message change 2019-06-29 05:08:23 -04:00
rocky
49d1a50354 Merge branch 'master' of github.com:rocky/python-uncompyle6 2019-06-29 04:59:46 -04:00
rocky
0dc19a8fdd Correct 3.4 "yield from" semantic action bug 2019-06-29 04:59:03 -04:00
R. Bernstein
f6aa8b2baf Merge pull request #264 from rocky/ifelif-27
if/elif for 2.5-2.7
2019-06-24 05:50:53 -04:00
rocky
887a006849 if/elif for 2.5-2.7
Specifically simple_source/03_if_elif.py
2019-06-23 21:29:15 -04:00
rocky
145c18fbeb Merge branch 'master' into python-2.4 2019-06-23 21:14:40 -04:00
rocky
e26c7407a0 Small changes to document some of the complexity. 2019-06-23 20:00:00 -04:00
rocky
18bb1bc9e3 Fix Python 2.xisms 2019-06-23 18:15:53 -04:00
rocky
c0e8ce22af Merge branch 'master' into python-2.4 2019-06-23 17:51:21 -04:00
R. Bernstein
69823af553 Merge pull request #262 from rocky/ifelif
reinstate some elif's
2019-06-23 17:27:57 -04:00
x0ret
e96498eaf0 Adjust ifelsestmtr grammer 2019-06-24 01:28:33 +04:30
rocky
9d6d6a355d Start to reinstate elif's 2019-06-21 07:13:05 -04:00
R. Bernstein
04c53c1086 Merge pull request #261 from rocky/load-code
LOAD_CONST -> LOAD_CODE where appropriate
2019-06-21 06:34:43 -04:00
rocky
96866f94a7 Adjust grammar checker to ignore LOAD_CODE 2019-06-19 15:54:16 -04:00
rocky
d371839c99 A few more LOAD_CONST->LOAD_CODE 2019-06-19 15:38:58 -04:00
rocky
24afe072b7 LOAD_CONST -> LOAD_CODE where appropriate 2019-06-19 14:43:07 -04:00
rocky
e2d7f01298 Handle 2-arg asserts in 3.6+ish
Changed files have also been reformatted via the blacken formatter
2019-06-18 22:09:16 -04:00
rocky
72a95e7cce Add back in validate. 2019-06-17 02:00:55 -04:00
rocky
b39112b601 One more deparse_code removal 2019-06-16 22:30:56 -04:00
rocky
3983aa1b92 One more deparse_code removal 2019-06-16 22:30:05 -04:00
rocky
8d85e78960 Merge branch 'master' into python-2.4 2019-06-16 22:00:33 -04:00
rocky
20b513fc81 Merge branch 'master' of github.com:rocky/python-uncompyle6 2019-06-16 21:58:23 -04:00
rocky
d369017122 remove deprecated deparse_code 2019-06-16 21:57:56 -04:00
rocky
d3eca29934 Merge branch 'master' into python-2.4 2019-06-15 10:09:44 -04:00
rocky
6675ea2cd0 Control flow yet again 2019-06-15 10:09:13 -04:00
rocky
4b82806d6c Flow control bites again.
See related appveyor https://ci.appveyor.com/project/rocky/python-decompile3/builds/25301153/job/x0we0dpgb3apgk1v
2019-06-15 07:18:30 -04:00
rocky
f3b72884c6 Merge hell? 2019-06-12 13:09:22 -04:00
rocky
504164fcea Merge branch 'master' into python-2.4 2019-06-12 13:08:30 -04:00
rocky
3c06b82931 Get ready for release 3.3.4 2019-06-12 12:01:31 -04:00
R. Bernstein
c680416f92 Merge pull request #255 from rocky/3.6-store_annotation
Add 3.6 STORE_ANNOTATION
2019-06-12 10:56:27 -04:00
rocky
58c8fe5a66 Oops - forgot to add the test source 2019-06-11 16:09:04 -04:00
rocky
aea1adeb85 Reinstate test 2019-06-11 16:04:29 -04:00
x0ret
c871a4ecc5 Fix subscript in store_annotation + indentation 2019-06-12 00:26:34 +04:30
rocky
cd9eca7bff Formatting change slighty 2019-06-11 14:14:45 -04:00
rocky
002720988c Formatting in < 3.0 is different for name ops 2019-06-11 14:08:50 -04:00
rocky
08f23567a6 Nicer assembly display...
Fewer extraneous quotes and remove pattrs that don't mean anything.
Base more on OP poperties like varargs and NAME_OPS
2019-06-11 12:44:29 -04:00
rocky
43348d7d24 CI testing take 3
This time, for sure!
2019-06-11 11:19:34 -04:00
rocky
164e9d4b5c CI testing take 2 2019-06-11 11:16:45 -04:00
rocky
37e4754268 Fix Improper semantic action format 2019-06-11 11:10:53 -04:00
rocky
c3257a9b79 CI testing - remove Python 2.6 testing and add 3.7 2019-06-11 11:05:50 -04:00
rocky
70b0704967 CI - remove 2.6 testing, add 3.7 testing 2019-06-11 11:03:43 -04:00
rocky
76dcaf9bf0 Tweaks to x0ret's anotation type handling
- match AST names a little better: AnnAssign -> ann_assign...
- localize Annotation type grammar change only when we have it
- Add reduce rule to combine assignment and annotate declaration
- Add annotation-type test from Python 3.6
- Docuemnt what's up with annotation types
2019-06-11 11:02:25 -04:00
x0ret
21fd506fbb Add 3.6 STORE_ANNOTATION 2019-06-11 10:36:55 -04:00
rocky
efe0914814 See above. 2019-06-11 10:35:53 -04:00
rocky
5981c7eae9 Fix LOAD_STR messing up docstring comparision 2019-06-11 10:33:49 -04:00
R. Bernstein
36ef1607af Merge pull request #259 from rocky/annotation-types-final
Fix py3 function signatures + annotations + ordering
2019-06-09 18:34:10 -04:00
rocky
b2d97f9847 Possble use of ','.join to remove "ends_in_comma"? 2019-06-09 18:29:46 -04:00
rocky
24ba5d7f40 One more LOAD_CONST->LOAD_STR remnant and...
We're good to go!

All function signatures seem to be working! YAY!

Credit goes to x0ret
2019-06-09 18:20:05 -04:00
x0ret
eae3f0d77b Fix issue in commas in function signatures 2019-06-10 02:25:19 +04:30
x0ret
a54fba7993 Fix issue in commas in function signatures 2019-06-10 01:42:16 +04:30
rocky
719d2d7232 Correct order of pos vs kwargs in 3.0-3.2 2019-06-09 16:26:08 -04:00
x0ret
e82cabc278 Fix 2 issues in commas in function signatures 2019-06-10 00:29:34 +04:30
rocky
9ab086b207 Add more x0ret tests 2019-06-09 15:19:01 -04:00
x0ret
4022e80d6d Fix py3 function signatures + annotations + ordering 2019-06-09 23:46:33 +04:30
rocky
9811c5bc42 Nicer assembly output 2019-06-09 12:21:45 -04:00
rocky
354796fffd One more LOAD_CONST->LOAD_STR artifact 2019-06-09 11:10:14 -04:00
R. Bernstein
ab696b316a Merge pull request #257 from rocky/annotation-types-3.6
Annotation types 3.6
2019-06-09 10:48:41 -04:00
x0ret
2f99da8199 Fix leading * arg in function signature in 3.6 2019-06-09 19:06:57 +04:30
rocky
fd5f4fa5b8 Nicer LOAD_STR assembly output 2019-06-09 09:53:21 -04:00
R. Bernstein
8e4168674d Merge pull request #252 from rocky/string-const
[WIP] LOAD_CONST->LOAD_STR for Python 3.x
2019-06-09 03:18:07 -04:00
rocky
c8fc6a704c LOAD_CONST->LOAD_STR bugs and 3.4 kwargsonly 2019-06-09 02:18:21 -04:00
rocky
622d6f849c Merge branch 'master' into string-const 2019-06-09 01:20:53 -04:00
rocky
aa21fe0b31 Give up on 3.8 in this branch 2019-06-08 18:57:43 -04:00
rocky
2995acb8d9 Merge branch 'master' into python-2.4 2019-06-08 18:57:08 -04:00
R. Bernstein
10d8aed4c0 Merge pull request #253 from rocky/annotation-types-3.5
Revise annotation type implementation for < 3.6
2019-06-08 18:43:04 -04:00
rocky
86fd5dbf7a 3.3-3.4 pos kwargs ordering 2019-06-08 18:40:50 -04:00
R. Bernstein
9fe1752359 Merge pull request #254 from rocky/origin/annotation-types-3.5
Add kwonly parsing.
2019-06-08 17:59:51 -04:00
x0ret
48ae7a6964 Fix kwonly args annotation handling 2019-06-09 01:38:42 +04:30
rocky
117b4ff4f1 Add kwonly parsing.
* annotation parsing for kwonly args is missing.
* Start filling out runnable tests. More work is needed on tests.
* refresh incorrect bytecode_3.3_run/15_assert.pyc
2019-06-08 15:29:18 -04:00
x0ret
e9002038f8 Revise annotation type implementation for < 3.6 2019-06-08 20:42:43 +04:30
rocky
9d47b99932 Another LOAD_STR/CONST isolation in < 3.0 2019-06-08 11:40:48 -04:00
rocky
59b012df6f localize LOAD_STR change to Python 3 2019-06-08 11:01:58 -04:00
rocky
44d7cbcf6f LOAD_CONST->LOAD_STR for Python 3.x 2019-06-08 02:28:27 -04:00
rocky
9bae73679f Reinstate 3.6. docstring test 2019-06-07 12:32:21 -04:00
rocky
ceebe9ab60 Add x0ret's annotation test on 3.6 2019-06-07 04:56:03 -04:00
R. Bernstein
b7e22b4530 Merge pull request #251 from rocky/annotation-types
x0ret's code in decompile3 for annotation types
2019-06-06 11:26:48 -04:00
x0ret
c7b20edba0 add annotations type test cases 2019-06-06 19:14:03 +04:30
rocky
64e35b09db Small simplification 2019-06-06 09:10:44 -04:00
rocky
3436a3a256 Merge branch 'master' into python-2.4 2019-06-06 08:45:18 -04:00
rocky
a0d4daf5ff Small typo 2019-06-06 08:44:19 -04:00
rocky
afa6a00db8 x0ret's code in decompile3 for annotation types 2019-06-06 06:39:02 -04:00
rocky
d634c5c17a Merge branch 'master' into python-2.4 2019-06-06 02:53:55 -04:00
rocky
d8f0d31475 better name for call generator rule 2019-06-06 02:53:04 -04:00
R. Bernstein
dd76a6f253 Merge pull request #250 from rocky/extra-parenthesis-genexpr-dryer
Extra parenthesis genexpr dryer
2019-06-06 02:02:25 -04:00
rocky
cb40caa73c DRY x0ret's code a little bit. 2019-06-05 20:35:06 -04:00
x0ret
fd59879510 feature #247: handle extra parenthesis in generators 2019-06-05 20:18:05 -04:00
R. Bernstein
c9cae2d09e Merge pull request #246 from rocky/async-await-generator
Bug in 3.5+ generator detection...
2019-06-05 20:16:24 -04:00
rocky
af209dc142 Bug in 3.5+ generator detection...
Also bug in 3.5 code detection for async attribute
2019-06-05 19:08:21 -04:00
rocky
f9fd63d5f5 Merge branch 'master' into python-2.4 2019-06-05 11:38:37 -04:00
R. Bernstein
ad419e0ed9 Merge pull request #243 from rocky/docstrings-again
Some docstring bugs fixed, some remain...
2019-05-31 08:37:41 -04:00
R. Bernstein
ee5c7da790 Merge pull request #244 from x0ret/docstrings-again
Fix unicode docstring again
2019-05-28 15:57:01 -04:00
x0ret
39c12704a8 fix unicode docstring again, handling unicode string in py2, fix docstring indentation 2019-05-28 15:11:44 +04:30
rocky
3b3fc09b60 Reinstate more docstring tests
But 3.{6,7} are stil broken
2019-05-27 20:59:29 -04:00
rocky
f7697ccd7b Some docstring bugs fixed, some remain...
I had broken escaping the tail quote by inadvertently switching from """
by default to '''.

Some additional tests have been added to 00_docstring.py for
this. However...

Unicode decoding is still broken. For now I've added  errors="ignore" to
.decode("utf-8", ...) until a better fix is found. Sigh.
2019-05-27 18:01:08 -04:00
R. Bernstein
e364499bb9 Merge pull request #242 from x0ret/master
Towards supporting unicode
2019-05-27 12:10:09 -04:00
x0ret
9db59f1b80 add support for generated source encoding 2019-05-27 17:19:10 +04:30
x0ret
a5cdb50154 towards supporting unicode: docstring 2019-05-27 17:00:08 +04:30
rocky
792ef5b5b8 Simplfy - TODO fix unicode in docstrings 2019-05-24 11:03:44 -04:00
rocky
123be56e5d Simplify docstrings...
main.py: 2.7ism creaped in.
2019-05-24 10:45:29 -04:00
rocky
7f46d8bb2a Merge branch 'master' into python-2.4 2019-05-24 10:37:51 -04:00
rocky
47ed0795b2 3.x docsting escaping works differently? 2019-05-24 09:53:56 -04:00
rocky
cccf33573b A runnable docstring test...
TODO: fix up the code! so this doesn't throw an assert error!
2019-05-24 02:29:23 -04:00
rocky
3c3e5c82fc Another small tweak 2019-05-21 17:04:09 -04:00
rocky
436260dc9a Small tweak 2019-05-21 17:02:24 -04:00
rocky
8f0674706b Grammar simplification 2019-05-21 16:10:12 -04:00
rocky
01cc184716 dict grammar rule cleanup 2019-05-21 15:09:40 -04:00
rocky
2771cb46ab short option -T for --tree+ 2019-05-21 11:38:43 -04:00
rocky
9ed4326f7e Administrivia 2019-05-21 08:29:03 -04:00
rocky
e3b10b62d7 Remove debug stmt 2019-05-21 07:19:08 -04:00
rocky
59b8f18486 Fix 3.7 list comprehension bug 2019-05-21 07:01:27 -04:00
rocky
bcf6939312 Merge branch 'master' of github.com:rocky/python-uncompyle6 2019-05-20 13:06:33 -04:00
rocky
3b7f49c01d Status area update and ...
Handle bytecode mismatch errors
2019-05-20 13:05:41 -04:00
R. Bernstein
ae976e991a Update README.rst 2019-05-20 09:14:46 -04:00
rocky
60d96b6a5a Merge branch 'master' into python-2.4 2019-05-19 17:11:30 -04:00
rocky
8fe6309650 Get ready for release 3.3.3 2019-05-19 16:55:52 -04:00
R. Bernstein
4c4aa393df Update HISTORY.md 2019-05-17 10:24:13 -04:00
R. Bernstein
a8b8c2908c Update README.rst 2019-05-15 03:25:06 -04:00
R. Bernstein
cb406e2581 Update README.rst 2019-05-15 03:24:33 -04:00
R. Bernstein
20b16c44ff Update README.rst 2019-05-15 03:22:05 -04:00
rocky
3abe8d11d3 3.7 handling of 4-level attribute import
Fixes #239
2019-05-14 12:09:38 -04:00
R. Bernstein
26140934da Merge pull request #237 from rocky/for-iter-come-from
Less dishonest COME_FROMs in 3.6+ code
2019-05-14 09:31:27 -04:00
x0ret
b62752eca1 2 more 3.7 chained comparison rule 2019-05-14 17:51:51 +04:30
rocky
9db446d928 Another 3.7 chained comparison rule 2019-05-14 07:26:18 -04:00
rocky
46acb74745 Only add forward-jumping COME_FROM in 3.6+
Is this a repeat commit?
2019-05-14 06:28:29 -04:00
rocky
44e1288e2f Less dishonest COME_FROMs
Addresses all of the problems seen in 3.7 datetime.py.

However we limit COME_FROMs only to forward jumps, not back (which in the case of Python code right now means looping) jumps.
2019-05-13 23:15:55 -04:00
R. Bernstein
ce9270dda0 Merge pull request #236 from x0ret/master
Python 3.7 decompiling full 3.7.3 library without error #235
2019-05-13 11:53:07 -04:00
x0ret
3d732db3cc fix chained compare parse error 2019-05-13 19:57:24 +04:30
x0ret
009a74da7d fix UnboundLocalError 2019-05-13 19:41:42 +04:30
R. Bernstein
251eb6da1b Merge pull request #233 from rocky/fstring
Revise format string handling
2019-05-13 09:43:47 -04:00
rocky
8b5e0f49f8 Handle {{ }} escape, but when appropriate 2019-05-13 09:41:16 -04:00
rocky
1cc08d9598 Make precedence table top-bottom order reference...
in https://docs.python.org/2/reference/expressions.html#operator-precedence or
https://docs.python.org/3/reference/expressions.html#operator-precedence
.
2019-05-13 09:41:16 -04:00
x0ret
d99e78d46d set precedences value for format strings 2019-05-13 09:41:09 -04:00
rocky
b94cce7b12 Revise format string handling
fstring_single{1,2} -> format_value{1,2} to match Python AST names
better
2019-05-13 09:40:32 -04:00
R. Bernstein
fe786b2b95 Merge pull request #232 from x0ret/master
handling LOAD_CONST in build_tuple and multiple call_ex_kw(s) issues
2019-05-12 06:11:11 -04:00
x0ret
bf56fbeeec enhance call_ex_kw(s) positional args handling 2019-05-12 13:11:31 +04:30
rocky
6d8d9fd83b Go over precedence in calls 2019-05-11 23:32:24 -04:00
rocky
78ca6a0c1f Add 3.7 testcase for ex_kw call 2019-05-11 19:37:44 -04:00
rocky
86dd321256 Accept x0ret's suggestion for 3.6+ if detection..
in the presense of a try block.

Fixes #229
2019-05-10 19:36:16 -04:00
rocky
4db364f701 And another tweak. 2019-05-10 17:29:03 -04:00
rocky
c03b039714 Small tweaks to last commit 2019-05-10 17:25:25 -04:00
R. Bernstein
d97509495e Merge pull request #230 from x0ret/master
implements n_call_ex_kw as discussed in #227
2019-05-10 16:57:44 -04:00
x0ret
4d793ba1b2 implements n_call_ex_kw as discussed in #227 2019-05-10 23:55:47 +04:30
R. Bernstein
590d2f44f1 Update README.rst 2019-05-10 09:29:47 -04:00
rocky
e875b79a75 Fix 3.6. call_ex_kw semantic action
Was missing positional args parameter in template. Fix submited by @x0ret

Fixes #227
2019-05-09 09:27:10 -04:00
rocky
b57ca392a2 2.7 confusion around "and" vs comprehension "if"
Fixes #225
2019-05-08 16:27:41 -04:00
rocky
a132e2ace6 Better 3.6+ async detection 2019-05-08 13:50:57 -04:00
rocky
f9bb0b0a46 Merge branch 'master' into python-2.4 2019-05-08 08:57:59 -04:00
rocky
b05500dd49 More 3.6+ fstring bugs 2019-05-08 08:57:30 -04:00
rocky
325bba5be5 Merge branch 'master' into python-2.4 2019-05-08 07:00:54 -04:00
rocky
65307f257c Administrivia 2019-05-08 06:06:53 -04:00
rocky
715bf9cbab Merge branch 'master' into python-2.4 2019-05-08 06:05:28 -04:00
rocky
8909fe8d37 Merge branch 'master' of github.com:rocky/python-uncompyle6 2019-05-08 06:04:11 -04:00
rocky
733a44e22f Revise and hopefully improve 3.6+ fstring handling 2019-05-08 06:03:39 -04:00
rocky
8187fdf4a6 Merge branch 'master' into python-2.4 2019-05-05 16:10:44 -04:00
rocky
f2f17740ee 2.7 if_expr_true restriction ...
condition_true -> if_expr_true
condition_lambda -> if_expr_lambda

These correspond to the Python AST names better.
2019-05-05 16:09:10 -04:00
rocky
393e5c9303 IfExp precidence handling in 2.6...
2.7 still has a bug
2019-05-05 09:48:20 -04:00
rocky
8c611476fe ifexpr -> if_expr (to track better AST camelcase) 2019-05-05 08:20:21 -04:00
rocky
6df65a87bc Fix precidence between list_if and if_expr in 3.x 2019-05-05 08:16:29 -04:00
rocky
bb94c7f5bc Ned custom 3.7+ IfExp rules 2019-05-04 22:57:06 -04:00
rocky
8e9ce0be31 3.7: if <expr> and not <expr> else <expr> 2019-05-04 22:14:07 -04:00
rocky
bc49469704 delete_subscr -> delete_subscript ...
to better (but not exactly) match the Python AST
2019-05-04 19:43:00 -04:00
rocky
5905cce1de Python 3.7 ifelse handling 2019-05-04 19:38:37 -04:00
rocky
af816c9e60 Administrivia 2019-05-03 23:25:25 -04:00
rocky
900a0980c1 Administrivia Add 2.6 back into older dist 2019-05-03 23:23:37 -04:00
rocky
da44660a72 2.6 doesn't have print_function 2019-05-03 23:22:01 -04:00
rocky
76c2883f62 Merge branch 'master' into python-2.4 2019-05-03 23:14:28 -04:00
rocky
82a3419eb2 Administrivia: bump testing versions 2019-05-03 23:11:42 -04:00
rocky
46ca21596f Get ready for release 3.3.2 2019-05-03 22:52:53 -04:00
rocky
6e753b8743 Handle 3.7 format_value tuples 2019-05-03 22:38:09 -04:00
rocky
0007abf827 Fix 3.6+ format string interpolation 2019-05-03 19:00:25 -04:00
rocky
7ecfb74e9a testtrue expr check nuked because of 3.7 2019-05-02 14:01:51 -04:00
rocky
2813e2212f tidy "not" precedence. 2019-05-02 11:44:20 -04:00
rocky
e2c5a79346 Add pypy3.6 scanner 2019-05-02 06:46:07 -04:00
rocky
293e7b0367 store_subscript precedence fix and...
Allow format specifier "%p" to indicate a nonterminal name,
like "%c" allows.

store_subscr -> store_subscript to match Python AST a little closer.
2019-05-02 06:43:53 -04:00
rocky
32bc017e2e Fix wrong node slot in 3.6 for except_handler 2019-05-01 14:23:00 -04:00
rocky
ce7015f382 Improve 3.x while1 reduction elimination 2019-05-01 11:10:16 -04:00
rocky
4cc53f2307 Python 3.6+ try/else with no trailing END_FINALLY 2019-05-01 09:46:56 -04:00
rocky
d2fccfe357 Merge branch 'master' into python-2.4 2019-05-01 09:18:12 -04:00
rocky
257bbc892f Better 3.6+ format specification handling 2019-05-01 09:17:35 -04:00
rocky
23b7e6db18 Better 3.6 FORMAT_VALUE handling 2019-04-30 23:09:26 -04:00
rocky
1727977828 Merge branch 'master' into python-2.4 2019-04-30 23:09:07 -04:00
rocky
fac365f216 Better fstring handling for FORMAT_VALUE | 0x4 2019-04-30 23:05:47 -04:00
rocky
f54cf20d9d Hacky handling of 3.6 format string 'X'. 2019-04-30 20:06:36 -04:00
rocky
03d23328eb 3.6 constant tuples in call 2019-04-30 16:25:48 -04:00
rocky
c074107504 Parser fix for 3.6 having long while loops 2019-04-30 15:46:00 -04:00
rocky
7fed369e88 Merge branch 'master' into python-2.4 2019-04-30 05:17:58 -04:00
rocky
a981db884c Pypy 3.6 tolerance 2019-04-30 05:12:42 -04:00
rocky
81bbb81a42 Merge branch 'master' into python-2.4 2019-04-27 04:41:14 -04:00
rocky
c5d7944e65 3.x while/else can now sometime have COME_FROMs 2019-04-27 04:37:24 -04:00
rocky
43dbf9b878 More 3.0 COME_FROMs 2019-04-23 19:31:27 -04:00
rocky
3fa444a98d Merge branch 'master' into python-2.4 2019-04-23 19:12:59 -04:00
rocky
efa964f7c9 del handling in 3.0 and add tests 2019-04-23 19:12:12 -04:00
rocky
5c58a4816f Fix 2.x delete statements expression confusion 2019-04-23 15:48:14 -04:00
rocky
5475934c0d Fix 2.x delete statements expression confusion 2019-04-23 15:44:05 -04:00
rocky
132a9acdb4 Was mssing 2.5 cond3 semantic rule 2019-04-23 13:09:14 -04:00
rocky
636257f879 Was mssing 2.5 cond3 semantic rule 2019-04-23 13:07:30 -04:00
rocky
c6bdfdd592 Merge branch 'master' into python-2.4 2019-04-23 11:54:58 -04:00
rocky
9186a3fc44 Fixes for pypy testing 2019-04-23 11:52:26 -04:00
rocky
05db6194ec Use up right 3.x opcodes in jump detection...
A small but pervasive, and I guess important change. More correct COME_FROMs
are now coming out. A number of grammar changes then in 3.0, 3.5, and 3.8
2019-04-23 05:14:29 -04:00
rocky
3730946a1a Add semantic rule for 3.x "conditionalnot" 2019-04-22 21:18:17 -04:00
rocky
f1b69a8a28 Add rule for 3.x comp_for 2019-04-22 18:42:21 -04:00
rocky
5a089c311a Merge branch 'master' into python-2.4 2019-04-19 06:03:07 -04:00
rocky
0e5eb954b2 Adminstrivia 2019-04-19 06:01:06 -04:00
rocky
7d9286b353 Get ready for release 3.3.1 2019-04-19 05:51:05 -04:00
rocky
0de99e5d44 Scale back "try" vs. "tryelse" reduction test on 3.6+ 2019-04-18 16:45:44 -04:00
rocky
52af2ba32a 3.6+ lambda parameter handling 2019-04-18 14:21:52 -04:00
rocky
bd0db6c539 Extend annotate test to 3.7 2019-04-18 09:47:54 -04:00
rocky
8663b4ca52 Fix bugs caused by last commit 2019-04-18 07:31:16 -04:00
rocky
b2dd58a85e Hacky attemp to add more 3.x annotate information in 2019-04-18 02:26:50 -04:00
rocky
97cb193a71 3.7 chained comparison grammar 2019-04-17 23:41:41 -04:00
rocky
e6e60cb49d 3.6 Chained compare 2019-04-17 15:44:33 -04:00
rocky
6c3639aef2 Merge branch 'master' into python-2.4 2019-04-16 10:41:17 -04:00
rocky
2ea8c3b1b1 3.7 and 3.8 chained compare fixups 2019-04-16 10:19:16 -04:00
rocky
701d2af54e Improve Python 2.7 generator handling 2019-04-15 23:14:44 -04:00
rocky
37ac0a3665 Merge branch 'master' into python-2.4 2019-04-15 20:35:01 -04:00
rocky
8a4189bc0e Python 2.6-2.7ish generator handling 2019-04-15 20:32:15 -04:00
rocky
40b910e4e2 Merge branch 'master' into python-2.4 2019-04-15 12:08:35 -04:00
rocky
0c4ab699b5 3.4+ while handling with returns ...
these while loops don't have a JUMP_BACK in them
2019-04-15 12:03:11 -04:00
rocky
8e11c53064 More cleanup from recent refactoring 2019-04-15 08:18:31 -04:00
rocky
b4c66d4307 Was missing some 3.7 and 3.7 semantic actions...
Possibly some as a result of the last refactor?
2019-04-15 08:11:31 -04:00
rocky
53968e535f Split up version-specific semantic action code more 2019-04-14 21:47:16 -04:00
rocky
d2381fbe11 Update dates and version numbers 2019-04-14 19:54:53 -04:00
rocky
e058377214 Merge branch 'master' into python-2.4 2019-04-14 19:29:52 -04:00
rocky
d413ebe0e1 Split out semantic actions per version ...
In version 3.5..3.8 there are quite hefty changes.
2019-04-14 19:25:56 -04:00
rocky
f96522e18e Add 3.8 try else 2019-04-14 19:01:33 -04:00
rocky
50d50af2ee Doc typo 2019-04-14 07:45:06 -04:00
rocky
57185d17fd 2.4-branch uncompyle6 doesn't support -c 2019-04-14 07:11:59 -04:00
rocky
f2e2bc7fa1 Merge branch 'master' into python-2.4 2019-04-14 07:11:10 -04:00
rocky
4dc2897cdc One last new item update 2019-04-14 07:10:30 -04:00
rocky
47fb80494d Get ready for release 3.3.0 2019-04-14 07:03:07 -04:00
rocky
830e19e3e6 Get ready for release 3.3.0 2019-04-14 06:59:49 -04:00
rocky
950035db9c Merge branch 'master' into python-2.4 2019-04-14 06:54:32 -04:00
rocky
c5cfd36a61 Start 3.8 async for/else 2019-04-14 06:54:08 -04:00
rocky
f36c11d9d7 Merge branch 'master' into python-2.4 2019-04-14 06:13:25 -04:00
rocky
9b550b9dda PEP E225 with a nod to Deepcommit 2019-04-14 06:11:16 -04:00
rocky
64a4b75ed9 Merge branch 'master' into python-2.4 2019-04-13 23:40:40 -04:00
rocky
400943bb6a 3.8 async for/with...
More is needed though.
2019-04-13 22:22:37 -04:00
rocky
f89ba40147 Adjust while True grammar rule 2019-04-13 20:46:13 -04:00
rocky
32c611a315 Adjust 3.8 while-stmt rules 2019-04-13 20:35:26 -04:00
rocky
5d91e96358 3.6-3.8 "async for" handling...
And add an if_stmt rule for 3.8. My want to extend it back to
other versions.
2019-04-13 18:31:40 -04:00
rocky
44edf1d7db 3.8 try/except handling - again (and more to come) 2019-04-12 03:20:13 -04:00
rocky
a891aa0706 More 3.8 try blocks 2019-04-11 16:42:28 -04:00
rocky
5e1340a2fc 3.8 exception handling 2019-04-11 12:09:24 -04:00
rocky
94eff282f8 3.8 try/except 2019-04-11 07:44:32 -04:00
rocky
7f65a8a6dd 3.8 SETUP_EXCEPT removal workaround; reinstate option -c | --compile 2019-04-11 07:19:35 -04:00
rocky
cfe7feed4d Fix 3.8 pytests 2019-04-10 22:58:15 -04:00
rocky
b3a20896b2 Remove dup pypy test 2019-04-10 12:35:26 -04:00
rocky
adc7e5242c More run tests 2019-04-10 12:32:34 -04:00
rocky
612a813c7c Merge branch 'master' into python-2.4 2019-04-10 12:03:39 -04:00
R. Bernstein
1425476018 Merge pull request #222 from rocky/python-3.8
Python 3.8
2019-04-10 12:00:03 -04:00
rocky
59c77f103d More self-checking run tests 2019-04-10 11:49:27 -04:00
rocky
726045a05e Basic 3.8+ "for" loop handling...
More Makefile mangling
2019-04-10 11:26:58 -04:00
rocky
49e354375e More run tests 2019-04-10 11:05:46 -04:00
rocky
f3d86e0708 Bang on Python 3.8 2019-04-10 07:22:43 -04:00
rocky
820283827f 3.8 "for" block ...
pysource: Tag older semantics for blocks with "expr" and "for_block"
2019-04-10 06:00:16 -04:00
rocky
8b65cc7275 Small changes - bump required xdis version 2019-04-09 21:45:28 -04:00
rocky
1e47f47527 Allow for newer xdis 2019-04-05 16:30:28 -04:00
rocky
19a95be3ef WIP - more 3.8 grammar stuff 2019-03-30 00:27:48 -04:00
rocky
5a6550b353 Administrivia: require xdis 3.9.1 or greater 2019-03-28 20:56:49 -04:00
rocky
82fb9426af [WIP] - move forward a tad on Python 3.8 2019-03-28 12:10:08 -04:00
rocky
199ba86984 Merge branch 'master' into python-2.4 2019-03-28 11:22:28 -04:00
rocky
98b91db8e6 Another 3.6->3.7 typo (in comment this time) 2019-03-28 11:22:07 -04:00
rocky
ce3f815b08 opcode import typo 2019-03-28 11:16:06 -04:00
rocky
c447b9cfa9 Note use of releases 2019-03-26 12:41:12 -04:00
rocky
a4ae9a39af Merge branch 'master' into python-2.4 2019-03-23 18:26:47 -04:00
rocky
ddf73b653c Use Python 2.7, not 3.7 2019-03-10 14:17:59 -04:00
rocky
83773846d6 Merge branch 'master' into python-2.4 2019-03-10 14:12:23 -04:00
rocky
8246f54831 Python 2.5. tolerance 2019-01-26 18:50:17 -05:00
rocky
92d6b62d56 Merge branch 'master' into python-2.4 2019-01-26 18:33:39 -05:00
rocky
bff171897a Merge branch 'master' into python-2.4 2018-12-30 12:28:02 -05:00
rocky
189d7c6562 Merge branch 'master' into python-2.4 2018-12-16 02:28:09 -05:00
rocky
a54a558a44 Merge branch 'master' into python-2.4 2018-12-10 06:40:41 -05:00
rocky
6443257e60 Merge branch 'master' into python-2.4 2018-11-12 10:29:40 -05:00
rocky
343f01cb8f Merge branch 'master' into python-2.4 2018-10-27 11:31:32 -04:00
rocky
87d0b6e3fb Merge branch 'master' into python-2.4 2018-09-20 17:40:46 -04:00
rocky
eb317480d8 Merge branch 'master' into python-2.4 2018-09-19 15:46:08 -04:00
rocky
663b6ca50f Merge branch 'master' into python-2.4 2018-08-12 06:48:10 -04:00
rocky
908dea4a23 Merge branch 'master' into python-2.4 2018-07-15 12:40:27 -04:00
rocky
309ccb8734 Merge branch 'master' into python-2.4 2018-07-05 21:50:13 -04:00
rocky
d687b44f70 Merge branch 'master' into python-2.4 2018-07-03 15:46:12 -04:00
rocky
b94d67e99a Remove CircleCI 1.1 2018-06-26 22:36:31 -04:00
rocky
1f8a5dfa06 Another CircleCI 2.0 try 2018-06-25 16:53:25 -04:00
rocky
d420b2864e Fix CircleCI testing? 2018-06-25 16:40:36 -04:00
rocky
12e46504f3 Another CircleCI 2.0 try 2018-06-25 13:33:36 -04:00
rocky
d3bd73c281 More CircleCI 2.0 config 2018-06-25 13:29:28 -04:00
rocky
86e29eaac8 More CircleCI 2.0 config 2018-06-25 13:28:39 -04:00
rocky
e934d79170 More CircleCI 2.0 config 2018-06-25 13:27:23 -04:00
rocky
398981e887 Try CircleCI 2.0 2018-06-25 13:17:14 -04:00
rocky
96c9a67554 Merge branch 'master' into python-2.4 2018-06-25 13:14:24 -04:00
rocky
44ffb04ee1 Merge branch 'master' into python-2.4 2018-06-23 23:09:43 -04:00
rocky
c78f9a3b7d Merge branch 'master' into python-2.4 2018-06-23 12:25:03 -04:00
rocky
f088ded236 Merge branch 'master' into python-2.4 2018-06-23 05:48:49 -04:00
rocky
beaedc7ca1 Merge branch 'master' into python-2.4 2018-06-22 21:10:20 -04:00
rocky
f9392ed908 Merge branch 'master' into python-2.4 2018-06-22 14:33:22 -04:00
rocky
eb30181e51 Merge branch 'master' into python-2.4 2018-06-19 12:28:58 -04:00
rocky
9edeb84adc Merge branch 'master' into python-2.4 2018-06-13 13:37:52 -04:00
rocky
f7a8aabdee Realign make_function3 with master 2018-06-13 13:21:46 -04:00
rocky
214f5f32a3 Merge branch 'master' into python-2.4 2018-06-13 13:13:05 -04:00
rocky
53b471a3df Merge branch 'master' into python-2.4 2018-06-12 15:05:40 -04:00
rocky
2b730628d5 Merge branch 'master' into python-2.4 2018-06-12 08:31:13 -04:00
rocky
48006ab350 Merge branch 'master' into python-2.4 2018-06-11 12:01:52 -04:00
rocky
b3642094b2 Now allow 3.0 2018-06-11 11:39:01 -04:00
rocky
a574168ca8 Merge branch 'master' into python-2.4 2018-06-11 11:38:19 -04:00
rocky
263b4b5653 Merge branch 'master' into python-2.4 2018-06-10 16:49:29 -04:00
rocky
19818ae632 Merge branch 'master' into python-2.4 2018-06-04 15:35:31 -04:00
rocky
477d73c71d Merge branch 'master' into python-2.4 2018-06-04 15:29:40 -04:00
rocky
7272ac4a60 Merge branch 'master' into python-2.4 2018-06-04 10:59:56 -04:00
rocky
7659277c5c Past fix of conditional_not bleed into 2.5...
and it shouldn't have
2018-05-19 12:58:45 -04:00
rocky
761eee7ae7 Merge branch 'master' into python-2.4 2018-05-19 12:36:34 -04:00
rocky
600cee26d9 Properly resolve a merge conflict 2018-05-11 10:25:35 -04:00
rocky
61466808f5 Merge branch 'master' into python-2.4 2018-05-08 09:18:32 -04:00
rocky
de25c5f003 Merge branch 'master' into python-2.4 2018-05-01 03:17:49 -04:00
rocky
8880568045 Merge branch 'master' into python-2.4 2018-04-29 10:09:03 -04:00
rocky
3c7d460036 Merge branch 'master' into python-2.4 2018-04-22 04:51:07 -04:00
rocky
ee3f2446f9 Merge branch 'master' into python-2.4 2018-04-16 13:10:16 -04:00
rocky
0b24eca8d7 Merge branch 'master' into python-2.4 2018-04-08 05:39:28 -04:00
rocky
3116ac8323 Merge branch 'master' into python-2.4 2018-04-08 05:27:16 -04:00
rocky
19bb16270d Merge conflicts 2018-04-03 10:56:27 -04:00
rocky
35c41f8065 Merge branch 'master' into python-2.4 2018-04-03 10:55:51 -04:00
rocky
9d36e7742e Merge branch 'master' into python-2.4 2018-04-01 15:17:37 -04:00
rocky
75f3624f31 Merge branch 'master' into python-2.4 2018-04-01 13:48:16 -04:00
rocky
2e78c007ee Merge branch 'master' into python-2.4 2018-03-27 04:10:47 -04:00
rocky
f5a10ed5d0 Merge branch 'master' into python-2.4 2018-03-26 19:41:20 -04:00
rocky
de75849ae3 Merge branch 'master' into python-2.4 2018-03-26 14:52:01 -04:00
rocky
30d6dcdd69 Merge branch 'master' into python-2.4 2018-03-26 12:56:54 -04:00
rocky
c48345a5c0 More grammar coverage work 2018-03-26 08:14:15 -04:00
rocky
a1cdc5e40c Grammar testing 2018-03-26 08:13:17 -04:00
rocky
661bfd4e52 Merge branch 'master' into python-2.4 2018-03-26 08:04:32 -04:00
rocky
6ac48bb0e1 Merge branch 'master' into python-2.4 2018-03-25 17:57:26 -04:00
rocky
a18b4b1505 Merge branch 'master' into python-2.4 2018-03-25 17:37:04 -04:00
rocky
b2c832e19f Merge branch 'master' into python-2.4 2018-03-24 10:55:43 -04:00
rocky
1462a8beb0 simply since we don't do 3.0 in this branch 2018-03-21 20:43:11 -04:00
rocky
f877e65919 Merge branch 'master' into python-2.4 2018-03-21 20:19:32 -04:00
rocky
78898ed187 Add PYTHON3 import 2018-03-21 19:59:35 -04:00
rocky
ef03d78c4d Merge branch 'master' into python-2.4 2018-03-21 19:57:59 -04:00
rocky
48b251273a Merge branch 'master' into python-2.4 2018-03-07 11:48:50 -05:00
rocky
c91b5e1164 Need additional try vs try/else checks 2018-03-07 07:37:13 -05:00
rocky
f8fd474b55 Merge branch 'master' into python-2.4 2018-03-07 07:36:41 -05:00
rocky
bc5f43ab05 Merge branch 'master' into python-2.4 2018-03-06 09:55:15 -05:00
rocky
1da2118e13 Merge branch 'master' into python-2.4 2018-03-05 12:26:45 -05:00
rocky
67e8f5d1a7 Merge branch 'master' into python-2.4 2018-03-05 07:55:17 -05:00
rocky
2a76013ed5 Merge branch 'master' into python-2.4 2018-03-04 21:46:46 -05:00
rocky
681bbd616b Merge branch 'master' into python-2.4 2018-03-02 11:14:01 -05:00
rocky
46390a161e Merge branch 'master' into python-2.4 2018-03-02 10:07:20 -05:00
rocky
28d0ec7a2a Merge branch 'master' into python-2.4 2018-03-02 08:06:53 -05:00
rocky
8a842c57d3 Omit empty parens in 2.4 2018-03-01 18:17:11 -05:00
rocky
fb333f1505 Merge branch 'master' into python-2.4 2018-03-01 17:22:45 -05:00
rocky
ab257dc7ce Merge branch 'master' into python-2.4 2018-02-27 17:49:22 -05:00
rocky
e3d8751338 Sync with master + lint 2018-02-27 10:41:46 -05:00
rocky
a1532bbfea Merge branch 'master' into python-2.4 2018-02-27 10:40:40 -05:00
rocky
128963d2e9 yield before 2.4 may need "None" 2018-02-22 22:23:57 -05:00
rocky
1cb9fc8b43 I hate conflicted merges 2018-02-22 21:46:05 -05:00
rocky
b9147b7872 Distingish 2.4-2.6 try from try/else 2018-02-22 20:24:21 -05:00
rocky
5496271000 Merge branch 'master' into python-2.4 2018-02-22 20:15:45 -05:00
rocky
16b5df4ba4 2.4 test_types was fixed by prior commit 2018-02-22 19:16:41 -05:00
rocky
fee6114d74 Merge branch 'master' into python-2.4 2018-02-22 19:15:24 -05:00
rocky
b14655dd43 == -> is 2018-02-21 18:08:27 -05:00
rocky
3de2890050 Merge branch 'master' into python-2.4 2018-02-21 17:43:37 -05:00
rocky
90ae3e42f6 Merge branch 'python-2.4' of github.com:rocky/python-uncompyle6 into python-2.4 2018-02-21 07:54:17 -05:00
rocky
158a1886fe Fix 2.4/2.5 try/else detection bug...
in a hacky way
2018-02-21 04:13:57 -05:00
rocky
d2285f0d61 remove a 2.7 runtest.sh exception 2018-02-21 02:54:40 -05:00
rocky
2e44ac25a1 Merge branch 'master' into python-2.4 2018-02-19 17:07:11 -05:00
rocky
9d425039a2 Merge branch 'master' into python-2.4 2018-02-17 11:28:45 -05:00
rocky
832f04a486 Merge branch 'master' into python-2.4 2018-02-15 10:47:14 -05:00
rocky
657d5ef024 pydisasm fixes 2018-02-15 07:33:51 -05:00
rocky
e92c2503d1 Merge branch 'master' into python-2.4 2018-02-15 07:31:11 -05:00
rocky
b74662cf3d Merge branch 'master' into python-2.4 2018-02-05 06:27:33 -05:00
rocky
ed3b0e81b9 Remove schmutz from merge 2018-01-31 16:52:43 -05:00
rocky
75755c8cfc Merge branch 'master' into python-2.4 2018-01-31 16:46:04 -05:00
rocky
4ce769399f Correct Python versions in CircleCI tests 2018-01-29 15:44:34 -05:00
rocky
d0dfdcfcde Add Some run tests 2018-01-29 15:41:19 -05:00
rocky
4e949a798d Merge branch 'master' into python-2.4 2018-01-29 15:41:14 -05:00
rocky
4fb379afb4 Get ready for release 2.15.0 2018-01-27 12:26:22 -05:00
rocky
eb7484c671 Merge branch 'master' into python-2.4 2018-01-27 11:47:57 -05:00
rocky
79470ffff7 Merge branch 'master' into python-2.4 2018-01-20 15:30:45 -05:00
rocky
44af6c42a2 Merge branch 'master' into python-2.4 2018-01-19 03:33:29 -05:00
rocky
d7380dc549 Merge branch 'master' into python-2.4 2018-01-19 03:18:23 -05:00
rocky
b2f6e1cf1a Merge branch 'master' into python-2.4 2018-01-18 19:05:19 -05:00
rocky
7c9437f0a9 Merge branch 'master' into python-2.4 2018-01-18 01:27:52 -05:00
rocky
162bb0a85f Merge branch 'master' into python-2.4 2018-01-13 01:05:38 -05:00
rocky
e44ccd5787 Merge branch 'master' into python-2.4 2018-01-12 20:57:10 -05:00
rocky
c4612b7484 Fix ok status on --weak-verify 2018-01-12 09:57:32 -05:00
rocky
731c5a2092 Merge branch 'master' into python-2.4 2018-01-12 09:57:17 -05:00
rocky
7efbd55b69 Merge branch 'master' into python-2.4 2018-01-11 21:55:43 -05:00
rocky
5dbec5b383 Merge branch 'master' into python-2.4 2018-01-11 10:35:49 -05:00
rocky
f28ad69c38 Merge branch 'master' into python-2.4 2018-01-11 01:48:28 -05:00
rocky
49a71819a1 Correct Python 2.5- decorator parsing 2018-01-10 11:02:54 -05:00
rocky
ed7d11525a Check Python version in setup.py ...
to make the code is compatible. Fixes #146
2018-01-10 09:49:39 -05:00
rocky
5b1dcccddc Merge branch 'master' into python-2.4 2018-01-10 09:39:39 -05:00
rocky
992a08f5ce Check Python version in setup.py ...
to make sure we are running a compatible version.
2018-01-10 09:38:55 -05:00
rocky
49ef408699 Reinstates run tests that now work 2018-01-09 08:48:57 -05:00
rocky
0487f2fb7a Merge branch 'master' into python-2.4 2018-01-09 08:40:31 -05:00
rocky
e43c8acd30 Merge branch 'master' into python-2.4 2018-01-09 03:19:48 -05:00
rocky
97604a93dd Small typo 2018-01-09 00:28:04 -05:00
rocky
d266e9e123 Merge branch 'master' into python-2.4 2018-01-09 00:23:33 -05:00
rocky
7ac8bf91df Merge branch 'master' into python-2.4 2018-01-08 23:21:24 -05:00
rocky
772d36015c 2.4-compatiblity for next iteration 2018-01-08 22:18:59 -05:00
rocky
f381211291 Merge branch 'master' into python-2.4 2018-01-08 22:13:05 -05:00
rocky
aca4cb233d Merge branch 'master' into python-2.4 2018-01-08 12:24:59 -05:00
rocky
01ef3b774f Merge branch 'master' into python-2.4 2018-01-08 11:44:11 -05:00
rocky
9041dead7f Merge branch 'master' into python-2.4 2018-01-07 21:36:19 -05:00
rocky
4ea308f75a Fix another 2.5- try/else bug (in a loop) 2018-01-07 08:36:17 -05:00
rocky
e5f06eb551 Fix bug 2.5- in try/else inside ifelsestmt 2018-01-06 22:10:05 -05:00
rocky
c68030e9fa Merge branch 'master' into python-2.4 2017-12-15 19:21:59 -05:00
rocky
fd95839701 Merge branch 'master' into python-2.4 2017-12-15 08:26:03 -05:00
rocky
6305023219 Handl 2.4- try/finally properly 2017-12-14 19:20:57 -05:00
rocky
c7dda72a84 Merge branch 'master' into python-2.4 2017-12-14 17:58:03 -05:00
rocky
7caedcb50d Merge branch 'master' into python-2.4 2017-12-14 09:51:50 -05:00
rocky
1856e09a0c 2.4 tolerance 2017-12-14 08:45:13 -05:00
rocky
e47568e147 Merge branch 'master' into python-2.4 2017-12-14 08:40:43 -05:00
rocky
c702ce3802 runtests for 2.4 and 2.5 2017-12-13 18:06:56 -05:00
rocky
a37f403410 Fix runtests.sh 2017-12-13 17:44:19 -05:00
rocky
9248a954bd Merge branch 'master' into python-2.4 2017-12-13 17:43:44 -05:00
rocky
89a7ad6f81 Update docs and failed decompiles (for 2.5) 2017-12-13 10:02:30 -05:00
rocky
f432f4f698 Update runtest failures 2017-12-13 09:24:59 -05:00
rocky
5ef2d5cd9f Merge branch 'master' into python-2.4 2017-12-13 08:58:18 -05:00
rocky
204612ca85 Merge branch 'master' into python-2.4 2017-12-12 11:05:20 -05:00
rocky
df8c092212 Merge branch 'master' into python-2.4 2017-12-10 18:12:14 -05:00
rocky
55d2e598db Merge branch 'master' into python-2.4 2017-12-10 18:11:13 -05:00
rocky
3c67c7b32c Administrivia 2017-12-10 18:10:51 -05:00
rocky
5264ffc0e5 Merge branch 'master' into python-2.4 2017-12-10 18:02:23 -05:00
rocky
27b217a4ed Merge branch 'master' into python-2.4 2017-12-09 04:53:21 -05:00
rocky
d756548ac3 Correct 10_del.py syntax 2017-12-05 22:44:33 -05:00
rocky
0171e4d899 remove from exclusion those stdlib test that now work 2017-12-05 18:21:15 -05:00
rocky
a2054fb7dd Merge branch 'master' into python-2.4 2017-12-05 18:14:03 -05:00
rocky
f07c9c6dcf Merge branch 'master' into python-2.4 2017-12-05 08:32:31 -05:00
rocky
c677c946ea Merge branch 'master' into python-2.4 2017-12-05 05:59:50 -05:00
rocky
87063851be Merge branch 'master' into python-2.4 2017-12-05 05:44:59 -05:00
rocky
516c1a7910 Merge branch 'master' into python-2.4 2017-12-05 00:13:59 -05:00
rocky
2293f77841 Make 2.4 compatible 2017-12-04 14:18:39 -05:00
rocky
212771244a Merge branch 'master' into python-2.4 2017-12-04 14:15:30 -05:00
rocky
5fc33aeef5 Merge branch 'master' into python-2.4 2017-12-04 09:41:49 -05:00
rocky
fff0d1c988 Include weird 2.6 bugs in 2.5 2017-12-03 20:22:29 -05:00
rocky
987b5a2290 Merge branch 'master' into python-2.4 2017-12-03 19:57:26 -05:00
rocky
910d210e52 Merge branch 'master' into python-2.4 2017-12-03 13:03:28 -05:00
rocky
b719a0ee35 Merge branch 'master' into python-2.4 2017-12-03 12:29:05 -05:00
rocky
25329d2752 Update runtest failures 2017-12-03 11:20:06 -05:00
rocky
df4d80ff26 Merge branch 'master' into python-2.4 2017-12-03 11:19:48 -05:00
rocky
13ab06ecb1 Fix bug in 2.6- except_cond3 2017-12-03 06:10:37 -05:00
rocky
72e2d1a2bf One more _come_from -> _come_froms 2017-12-03 05:19:20 -05:00
rocky
c90210c063 Grammar "COME_FROM"_from cleanups ...
tryelse constructs in 2.x fixed up
_come_from -> _come_froms (COME_FROM*)
consolidate come_froms rule into sincle parser.py

sync unit/test_grammar.py
2017-12-03 05:04:06 -05:00
rocky
21a8726a47 Merge branch 'master' into python-2.4 2017-12-03 03:34:50 -05:00
rocky
ca7f267103 Merge branch 'master' into python-2.4 2017-12-02 21:18:00 -05:00
rocky
7b15e54b7d Add "global" in functions that just read 2017-12-02 19:11:11 -05:00
rocky
ccd007355c Merge branch 'master' into python-2.4 2017-12-02 17:10:10 -05:00
rocky
36aba02093 Correct Python 2.4 importmultiple rule 2017-12-02 14:17:59 -05:00
rocky
a5dd330218 Merge branch 'master' into python-2.4 2017-12-02 13:23:07 -05:00
rocky
fc0eb87620 Python 2.4 compatability 2017-12-02 10:01:33 -05:00
rocky
0b9fca2263 Sync with master 2017-12-02 09:51:15 -05:00
rocky
0d9464bb92 Merge branch 'master' into python-2.4 2017-11-29 05:09:22 -05:00
rocky
ff435227e9 2.5 test for UNARY_CONVERT 2017-11-28 10:01:24 -05:00
rocky
fcdc3f67af Python 2.4 doesn't do "with" 2017-11-28 09:55:25 -05:00
rocky
299936e554 Merge branch 'master' into python-2.4 2017-11-28 09:22:24 -05:00
rocky
2e192f0467 2.3- import statement fixes 2017-11-27 22:16:36 -05:00
rocky
9062f19a97 2.4 grammar reduction 2017-11-27 21:55:26 -05:00
rocky
f51e40a1de Merge branch 'master' into python-2.4 2017-11-27 21:41:01 -05:00
rocky
e411024696 Merge hell 2017-11-27 19:44:47 -05:00
rocky
01a27e22b4 2.5 grammar reduction and increase coverage 2017-11-27 19:39:37 -05:00
rocky
7553c4aed9 Add UNARY_INVERT_OP test 2017-11-27 12:49:39 -05:00
rocky
593304bc43 Administrivia 2017-11-27 12:40:44 -05:00
rocky
a9ca30fe34 Reduce Python 2.5- grammar rules 2017-11-27 12:17:10 -05:00
rocky
6030730870 Merge branch 'master' into python-2.4 2017-11-27 07:33:23 -05:00
rocky
b9436e4851 Merge branch 'master' into python-2.4 2017-11-26 19:24:24 -05:00
rocky
b0a7452d48 2.7 tryfinally grammar rule removal 2017-11-26 15:34:00 -05:00
rocky
5e05e521d9 Merge branch 'master' into python-2.4 2017-11-26 10:08:59 -05:00
rocky
7a052c349a Merge branch 'master' into python-2.4 2017-11-26 09:33:25 -05:00
rocky
35aca37557 Isolate kv, kv2, and kdv3 better 2017-11-26 06:53:22 -05:00
rocky
57fe56d72e localize kv 2017-11-26 01:35:03 -05:00
rocky
218e73540a Merge branch 'master' into python-2.4 2017-11-26 01:27:56 -05:00
rocky
0965e2cc96 Localize kv 2017-11-26 01:26:57 -05:00
rocky
5cf4f0a82f Merge hell 2017-11-25 23:15:07 -05:00
rocky
9b0225db60 Merge branch 'master' into python-2.4 2017-11-25 23:15:01 -05:00
rocky
8c0959de42 inf and nan tests 2017-11-25 23:11:27 -05:00
rocky
ccd71c857f Regularze grammar coverage rules 2017-11-24 22:44:22 -05:00
rocky
b89dbb0ee7 Merge hell 2017-11-24 21:48:24 -05:00
rocky
a5bdc1acd0 Merge branch 'master' into python-2.4 2017-11-24 21:48:14 -05:00
rocky
a279784d8d Merge branch 'master' into python-2.4 2017-11-23 17:17:54 -05:00
rocky
3a9f4f2984 Merge branch 'master' into python-2.4 2017-11-23 12:37:00 -05:00
rocky
51ae8313cf Merge branch 'master' into python-2.4 2017-11-22 14:45:16 -05:00
rocky
38f04f0073 More complete grammar coverage 2017-11-22 11:15:39 -05:00
rocky
f3da5d770d Merge hell 2017-11-22 06:26:20 -05:00
rocky
24fb13cf23 Merge branch 'master' into python-2.4 2017-11-22 06:25:52 -05:00
rocky
524e8c8410 Python 2.5 "with". isolate 2.5-2.7 grammar better 2017-11-16 09:18:26 -05:00
rocky
52d1e44560 Merge branch 'master' into python-2.4 2017-11-16 09:18:19 -05:00
rocky
6055c5e165 Get ready for release python-2.4- 2017-11-13 10:58:46 -05:00
rocky
e0ed187ea6 2.4isms...
Need print without parens. Handle old-style classes more properly?
2017-11-13 10:52:43 -05:00
rocky
eafe048c7e Get ready for release python-2.4-2.13.3 2017-11-13 10:12:27 -05:00
rocky
c0e553dbb5 Merge branch 'master' into python-2.4 2017-11-13 10:11:00 -05:00
rocky
7e59987af7 Merge branch 'master' into python-2.4 2017-10-12 07:31:19 -04:00
rocky
1f012f7c46 Merge conflicts 2017-10-12 07:18:11 -04:00
rocky
d1a3d42ab8 Sync 2017-10-12 07:08:58 -04:00
rocky
05fd992c48 Update news 2017-10-12 07:06:19 -04:00
rocky
47f1d888eb Merge branch 'master' into python-2.4 2017-10-12 07:05:34 -04:00
rocky
ca9c227837 More administrivia 2017-10-11 22:17:50 -04:00
rocky
5df384bb71 Some admin tools I use 2017-10-11 21:16:35 -04:00
rocky
e80b36347a Remove creaping Python 2.6ism 2017-10-11 20:43:17 -04:00
rocky
9e37495493 Sync with master 2017-10-10 23:06:22 -04:00
rocky
77b93c5f21 Sync with master 2017-10-10 23:04:25 -04:00
rocky
0b198ee881 Sync with master 2017-10-10 23:02:20 -04:00
rocky
9e0c65881d Sync with master 2017-10-10 22:52:07 -04:00
rocky
c796d6a799 Merge commit '1d7a3c6444eab5a02d899f789f2a57cfdcbc5a84' into python-2.4 2017-10-10 22:50:28 -04:00
rocky
3892fb533a Misc bugs 2017-10-10 16:12:02 -04:00
rocky
2ea7487ca7 One more test 2017-10-05 11:19:36 -04:00
rocky
d4f6cec3d0 Sync with master 2017-10-05 11:17:49 -04:00
rocky
b1705e283d handle newer parser reduction behavior 2017-10-03 11:54:24 -04:00
rocky
eee751e22a Go over table-semantics description yet again 2017-10-03 05:44:55 -04:00
rocky
2b0fefb95f Sync with master 2017-10-02 03:12:26 -04:00
rocky
1a627ba207 Annotation field can be unicode...
When deparsing Python 3.x from Python 2.
2017-09-26 09:53:26 -04:00
rocky
ea75bcf47e Require xdis 3.6.0 or greater 2017-09-25 20:11:53 -04:00
rocky
6c6dcab857 Merge branch 'python-2.4' of github.com:rocky/python-uncompyle6 into python-2.4 2017-09-25 20:09:04 -04:00
rocky
0654aed6c8 Get ready for release 2.12.0 2017-09-25 20:08:50 -04:00
rocky
3447ca0767 Unit test for format-specifiers 2017-09-21 11:29:17 -04:00
rocky
1e858efafd Tidy pysource and fragments 2017-09-20 19:08:41 -04:00
rocky
ce88a72ea1 Tidy/regularize table entry formatting 2017-09-20 17:52:48 -04:00
rocky
7725b8e7de small fixes...
test_pythonlib.py: it is sys.exit not exit
pysource.py: restore node type on async_call function
2017-09-20 11:30:50 -04:00
rocky
62ddbe320d Start pysource unit test 2017-09-20 01:15:37 -04:00
rocky
a694601264 emgine -> template_engine 2017-09-17 12:03:49 -04:00
rocky
e06f88043f Merge branch 'master' into python-2.4 2017-08-31 09:54:23 -04:00
rocky
8fc3fd146f Merge branch 'master' into python-2.4 2017-08-31 09:47:02 -04:00
rocky
ce5066bddb Merge branch 'master' into python-2.4 2017-08-15 11:12:20 -04:00
rocky
93f18e2449 Allow version to be string...
in get_python_parser and get_scanner
2017-08-13 09:23:27 -04:00
rocky
783e62f3ca Merge branch 'python-2.4' of github.com:rocky/python-uncompyle6 into python-2.4 2017-08-10 09:45:11 -04:00
rocky
c38dc61021 xdis "is not" is now "is-not" 2017-08-09 22:07:32 -04:00
rocky
45782bbb39 Get ready for release 2.11.3 2017-08-09 21:46:27 -04:00
rocky
4c9cd5657e Merge branch 'master' into python-2.4 2017-08-09 21:45:50 -04:00
rocky
dc627d13b8 Get ready for release 2.11.3 2017-08-09 21:33:01 -04:00
rocky
ddc3489991 Python 2.4 comptiability and ...
exception match -> exception-match
2017-08-03 03:48:57 -04:00
rocky
5b24c20331 Bump xdis 2017-08-02 08:37:50 -04:00
rocky
8bb01143d8 Remove six from python 2.4/2.5 2017-08-02 08:28:08 -04:00
rocky
a9635da96a in xdis "exception match" is now "exception-match" 2017-08-02 06:36:40 -04:00
rocky
e790cb75fd Python 2.4 doesn't do six 2017-08-02 06:20:07 -04:00
rocky
348afeebbf Python 2.4 compatibility 2017-08-01 22:32:43 -04:00
rocky
6888553773 Merge branch 'master' into python-2.4 2017-06-25 18:56:31 -04:00
rocky
0f489672b9 More merge fixups from master 2017-06-18 16:05:22 -04:00
rocky
b7d8cbfaf5 Merge branch 'master' into python-2.4 2017-06-18 15:40:40 -04:00
rocky
df8d253f78 2.4 doesn't do six 2017-06-03 06:00:47 -04:00
rocky
89b42e3696 Nope it (appveyor) doesn't. 2017-06-03 05:55:21 -04:00
rocky
22e5a4a283 Administrivia
See if appveyor will handle 2.5
2017-06-03 05:53:41 -04:00
rocky
61810172d1 Merge branch 'master' into python-2.4 2017-06-03 05:50:42 -04:00
rocky
658c8b4be7 No decorators in Python < 2.6 2017-05-30 02:30:56 -04:00
rocky
d4dab54c7b Merge branch 'master' into python-2.4 2017-05-30 02:18:57 -04:00
rocky
5566b9ba6c Get ready for release 2.9.11 2017-05-06 07:49:09 -04:00
rocky
e56ab2dcd5 Sync with master 2017-05-06 07:17:04 -04:00
rocky
d6c45979ba Merge branch 'master' into python-2.4 2017-05-06 07:16:39 -04:00
rocky
a06e9bf32e Merge branch 'master' into python-2.4 2017-04-14 05:45:53 -04:00
rocky
7e8f7ba674 namedtuple25 -> namedtuple24 2017-04-14 05:42:44 -04:00
rocky
09eb7f7f78 Merge branch 'master' into python-2.4 2017-04-10 00:48:04 -04:00
rocky
f7a910ec66 Merge branch 'master' into python-2.4 2017-03-01 05:55:26 -05:00
rocky
6d6a73eea7 Merge branch 'master' into python-2.4 2017-02-25 21:02:12 -05:00
rocky
e4a7641927 Python <= 2.6 grammar fixes 2017-02-25 05:13:19 -05:00
rocky
b24b46d48c Merge branch 'master' into python-2.4 2017-02-25 04:48:06 -05:00
rocky
a65d7dce5b Python 2.5 was missing try else stmt 2017-02-22 05:30:07 -05:00
rocky
718a0a5d34 Merge branch 'master' into python-2.4 2017-02-22 05:29:49 -05:00
rocky
ea9e3ab3f5 Group coverage Makefile targets 2017-02-10 01:00:26 -05:00
rocky
770e988ff8 Changes based on coverage information 2017-01-29 22:54:30 -05:00
rocky
0fa0641974 Merge branch 'master' into python-2.4 2017-01-29 22:05:55 -05:00
rocky
c13e23cdae Get ready for release 2.9.9 2017-01-11 21:52:20 -05:00
rocky
fab4ebb768 Merge changes ...
* str() in Python 2.4 doesn't detect unicode.
* index() doesn't work on tuples
* ifelse change
2017-01-11 19:34:28 -05:00
rocky
89429339fa Merge branch 'master' into python-2.4 2017-01-11 19:25:44 -05:00
rocky
6ed129bd7a 2.4 verify hacks 2017-01-02 07:15:46 -05:00
rocky
c4fde6b53e Merge branch 'master' into python-2.4 2017-01-02 05:39:50 -05:00
rocky
a7d93e88b4 Merge branch 'master' into python-2.4 2017-01-02 05:39:13 -05:00
rocky
9891494142 We are version 2.9.9 2016-12-31 18:16:23 -05:00
rocky
f8544dfbbe 2.7->2.4 conversion 2016-12-31 10:56:43 -05:00
rocky
b00651d428 Merge master branche
Handle 2.2 list_if
2016-12-31 05:19:21 -05:00
rocky
da8dccbaca Merge branch 'master' into python-2.4 2016-12-29 02:08:12 -05:00
rocky
37272ae827 Merge commit '9b1dd0f' into python-2.4 2016-12-27 10:32:25 -05:00
rocky
7f2bee46b7 Bug in using python2 ast checking in python 2.5 2016-12-26 01:55:16 -05:00
rocky
c8a4dcf72b Removing NAME_MODULE, lint and bug fixes
scanner*.py: show_asm param is optional
verify.py: call correct scanners
main.py, verify.py: Use older Python print statements
2016-12-25 09:16:04 -05:00
rocky
012ff91cfb Merge branch 'master' into python-2.4 2016-12-25 07:57:17 -05:00
rocky
e690ddd50a Merge branch 'master' into python-2.4 2016-12-18 07:43:15 -05:00
rocky
45b7c1948c show-asm on python2.5 is optional
Make scanner2 a little more like scanner3.
2016-12-17 07:57:31 -05:00
rocky
e2fb7ca3d2 Python 2.6/2.7 tolerance in Python 2.4 branch 2016-12-17 06:51:47 -05:00
rocky
b3bda76582 Merge branch 'master' into python-2.4 2016-12-16 22:56:07 -05:00
rocky
ab6d322eca Get ready for release 2.9.7 2016-12-04 14:09:53 -05:00
rocky
1a8a0df107 Merge branch 'master' into python-2.4 2016-12-04 13:40:06 -05:00
rocky
0a37709b0a CircleCI build 2016-11-24 05:41:31 -05:00
rocky
98cd1417df Remove dup Python 3 grammar rule 2016-11-24 05:36:43 -05:00
rocky
460069ceaa Bug in 2.4 "if" dectection and...
Wrong language used in old-style exceptions: use "except Error,e" not
"except Error(e)""
2016-11-24 05:15:35 -05:00
rocky
316aa44f23 Python 2.6 grammary bug and..
__pkginfo.py__: Bump spark_parser version for parse_flags 'dups'
2016-11-24 04:09:32 -05:00
rocky
7133540c23 Make work on 2.4 2016-11-23 08:26:12 -05:00
rocky
590231741d Merge branch 'come-from-type' into python-2.4 2016-11-23 07:54:18 -05:00
rocky
a9349b8f3d Making it run on Python 2.4 and 2.5 2016-11-23 07:53:51 -05:00
522 changed files with 18985 additions and 6134 deletions

View File

@@ -1,15 +1,6 @@
# This configuration was automatically generated from a CircleCI 1.0 config.
# It should include any build commands you had along with commands that CircleCI
# inferred from your project structure. We strongly recommend you read all the
# comments in this file to understand the structure of CircleCI 2.0, as the idiom
# for configuration has changed substantially in 2.0 to allow arbitrary jobs rather
# than the prescribed lifecycle of 1.0. In general, we recommend using this generated
# configuration as a reference rather than using it in production, though in most
# cases it should duplicate the execution of your original 1.0 config.
version: 2
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.
@@ -18,18 +9,10 @@ jobs:
CIRCLE_ARTIFACTS: /tmp/circleci-artifacts
CIRCLE_TEST_REPORTS: /tmp/circleci-test-results
COMPILE: --compile
# In CircleCI 1.0 we used a pre-configured image with a large number of languages and other packages.
# In CircleCI 2.0 you can now specify your own image, or use one of our pre-configured images.
# The following configuration line tells CircleCI to use the specified docker image as the runtime environment for you job.
# We have selected a pre-built image that mirrors the build environment we use on
# the 1.0 platform, but we recommend you choose an image more tailored to the needs
# of each job. For more information on choosing an image (or alternatively using a
# VM instead of a container) see https://circleci.com/docs/2.0/executor-types/
# 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/build-image:ubuntu-14.04-XXL-upstart-1189-5614f37
command: /sbin/init
- image: circleci/python:2.7
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
@@ -39,28 +22,22 @@ jobs:
# 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: pyenv local 2.7.11 && pyenv rehash && pip install virtualenv && pip install nose && pip install pep8 && pip install six && pyenv rehash
# 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:
# This branch if available
- v1-dep-{{ .Branch }}-
# Default branch if not
- v1-dep-master-
# Any branch if there are none on the default branch - this should be unnecessary if you have your default branch configured correctly
- v1-dep-
- v2-dependencies-{{ .Branch }}-
# fallback to using the latest cache if no exact match is found
- v2-dependencies-
# This is based on your 1.0 configuration file or project settings
- run: pip install --upgrade setuptools
- run: pip install -e .
- run: pip install pytest==3.2.5 hypothesis==3.0.0
- run:
command: sudo easy_install xdis spark-parser && sudo pip install -e . && sudo pip install -r requirements-dev.txt
# Save dependency cache
- save_cache:
key: v1-dep-{{ .Branch }}-{{ epoch }}
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
@@ -69,14 +46,13 @@ jobs:
- ~/.m2
- ~/.ivy2
- ~/.bundle
- ~/.go_workspace
- ~/.gradle
- ~/.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: python ./setup.py develop && make check-2.7
- run: cd ./test/stdlib && pyenv local 2.7.11 && bash ./runtests.sh 'test_[p-z]*.py'
- run: sudo python ./setup.py develop && make check-2.7
- 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

View File

@@ -11,7 +11,7 @@ Please remove any of the optional sections if they are not applicable.
Prerequisites
* Make sure the bytecode you have can be disassembled with a
disassembler.
disassembler and produces valid results.
* Don't put bytecode and corresponding source code on any service that
requires registration to download.
* When you open a bug report there is no privacy. If the legitimacy of
@@ -35,7 +35,7 @@ decompiler service for versions of Python up to 2.6.
## How to Reproduce
<!-- Please show both the input you gave and the
<!-- Please show both the *input* you gave and the
output you got in describing how to reproduce the bug:
or give a complete console log with input and output
@@ -63,7 +63,7 @@ can add that too.
Please modify for your setup
- Uncompyle6 version: output from `uncompyle6 --version` or `pip show uncompyle6`
- Python version: `python -V`
- Python version for the version of Python the byte-compiled the file: `python -c "import sys; print(sys.version)"` where `python` is the correct Cpython or Pypy binary.
- OS and Version: [e.g. Ubuntu bionic]
-->

1
.gitignore vendored
View File

@@ -6,6 +6,7 @@
/.eggs
/.hypothesis
/.idea
/.mypy_cache
/.pytest_cache
/.python-version
/.tox

View File

@@ -1,16 +1,7 @@
language: python
python:
- '3.5'
- '2.7'
- '2.6'
- '3.4'
- '3.6'
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:
- pip install -e .

View File

@@ -115,7 +115,7 @@ mechanisms and addressed problems and extensions by some other means.
Specifically, in `uncompyle`, decompilation of python bytecode 2.5 &
2.6 is done by transforming the byte code into a pseudo-2.7 Python
bytecode and is based on code from Eloi Vanderbeken. A bit of this
could have bene easily added by modifying grammar rules.
could have been easily added by modifying grammar rules.
This project, `uncompyle6`, abandons that approach for various
reasons. Having a grammar per Python version is much cleaner and it

View File

@@ -40,12 +40,20 @@ check-3.0 check-3.1 check-3.2 check-3.6:
check-3.7: pytest
$(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
2.6 5.0 5.3 5.6 5.8:
#:PyPy pypy3-2.4.0 Python 3:
pypy-3.2 2.4:
#:PyPy pypy3-2.4.0 Python 3.6.1:
7.1 pypy-3.2 2.4:
$(MAKE) -C test $@
#:PyPy pypy3-2.4.0 Python 3.6.9:
7.2:
$(MAKE) -C test $@
#: Run py.test tests

482
NEWS.md
View File

@@ -1,3 +1,311 @@
3.6.4: 2020-2-9 Plateau
=======================
The main focus in this release was fix some of the more glaring problems creapt in from the last release due to that refactor.
`uncompyle6` code is at a plateau where what is most needed is a code refactoring. In doing this, until everything refactored and replaced, decomplation may get worse.
Therefore, this release largely serves as a checkpoint before more major upheaval.
The upheaval, in started last release, I believe the pinnicle was around c90ff51 which wasn't a release. I suppose I should tag that.
After c90ff5, I started down the road of redoing control flow in a more comprehensible, debuggable, and scalable way. See [The Control Flow Mess](https://github.com/rocky/python-uncompyle6/wiki/The-Control-Flow-Mess)
The bulk of the refactoring going on in the [decompyle3](https://github.com/rocky/python-decompil3) project, but I try to trickle down the changes.
It is tricky because the changes are large and I have to figure decompose things so that little testable pieces can be done. And there is also the problem that what is in decompyle3 is incomplete as well.
Other than control flow, another change that will probably happen in the next release is to redo the grammar for lambda expressions. Right now, we treat them as Python statements, you know, things with compound statements in them. But lambda aren't that. And so there is hackery to paper over difference making a statement out of an expression the wrong thing to do. For example, a return of an "and" expression can be expressed as nested "if" statements with return inside them, but the "if" variant of the bytecode is not valid in a lambda.
In the decompyle3 code, I've gone down the road making the grammar goal symbol be an expression. This also offers the opportunity to split the grammar making parsing inside lambda not only more reliable because the wrong choices don't exist, but also simpler and faster because all those rules just need don't need to exist in parsing.
I cringe in thinking about how the code has lived for so long without noticing such a simple stupidity, and lapse of sufficient thought.
Some stats from testing. The below give numbers of decompiled tests from Python's test suite which succesfully ran
```
Version test-suites passing
------- -------------------
2.4.6 243
2.5.6 265
2.6.9 305
3.3.7 300
3.4.10 304
3.5.9 260
3.6.10 236
3.7.6 306
3.8.1 114
```
Decompiled bytecode files distributed with Python (syntax check only):
```
2.7.17 647 files: 0 failed
3.2.6 900 files: 0 failed
3.3.7 1256 files: 0 failed
3.4.10 800 files: 0 failed
3.5.9 900 files: 0 failed
3.6.10 1300 files: 28 failed
```
3.6.3: 2020-1-26 Martin and Susanne
===================================
Of late, every release fixes major gaps and embarrassments of the last release....
And in some cases, like this one, exposes lacuna and rot.
I now have [control] flow under control, even if it isn't the most optimal way.
I now have greatly expanded automated testing.
On the most recent Python versions I regularly decompile thousands of Python programs that are distributed with Python. when it is possible, I then decompile Python's standard test suite distributed with Python and run the decompiled source code which basically checks itself. This amounts to about 250 test programs per version. This is in addition to the 3 CI testing services which do different things.
Does this mean the decompiler works perfectly? No. There are still a dozen or so failing programs, although the actual number of bugs is probably smaller though.
However, in perparation of a more major refactoring of the parser grammar, this release was born.
In many cases, decompilation is better. But there are some cases where decompilation has gotten worse. For lack of time (and interest) 3.0 bytecode suffered a hit. Possibly some code in the 3.x range did too. In time and with cleaner refactored code, this will come back.
Commit c90ff51 was a local maxiumum before, I started reworking the grammar to separate productions that were specific to loops versus those that are not in loops.
In the middle of that I added another grammar simplication to remove singleton productions of the form `sstmts-> stmts`. These were always was a bit ugly, and complicated output.
At any rate if decompilation fails, you can try c90ff51. Or another decompiler. `unpyc37` is pretty good for 3.7. wibiti `uncompyle2` is great for 2.7. `pycdc` is mediocre for Python before 3.5 or so, and not that good for the most recent Python. Geerally these programs will give some sort of answer even if it isn't correct.
decompyle3 isn't that good for 3.7 and worse for 3.8, but right now it does things no other Python decompiler like `unpyc37` or `pycdc` does. For example, `decompyle3` handles variable annotations. As always, the issue trackers for the various programs will give you a sense for what needs to be done. For now, I've given up on reporting issues in the other decompilers because there are already enough issues reported, and they are just not getting fixed anyway.
3.6.2: 2020-1-5 Samish
======================
Yet again the focus has been on just fixing bugs, mostly geared in the
later 3.x range. To get some sense what sill needs fixing, consult
test/stdlib/runtests.sh. And that only has a portion of what's known.
`make_function.py` has gotten so complex that it was split out into 3 parts
to handle different version ranges: Python <3, Python 3.0..3.6 and Python 3.7+.
An important fix is that we had been dropping docstrings in Python 3 code as a result
of a incomplete merge from the decompile3 base with respect to the transform phase.
Also important (at least to me) is that we can now handle 3.6+
variable type annotations. Some of the decompile3 code uses that in
its source code, and I now use variable annotations in conjunction
with mypy in some of my other Python projects
Code generation for imports, especially where the import is dotted
changed a bit in 3.7; with this release are just now tracking that
change better. For this I've added pseudo instruction
`IMPORT_NAME_ATTR`, derived from the `IMPORT_NAME` instruction, to
indicate when an import contains a dotted import. Similarly, code for
3.7 `import .. as ` is basically the same as `from .. import`, the
only difference is the target of the name changes to an "alias" in the
former. As a result, the disambiguation is now done on the semantic
action side, rathero than in parsing grammar rules.
Some small specific fixes:
* 3.7+ some chained compare parsing has been fixed. Other remain.
* better if/else rule checking in the 3.4 and below range.
* 3.4+ keyword-only parameter handling was fixed more generally
* 3.3 .. 3.5 keyword-only parameter args in lambda was fixed
3.6.1: 2019-12-10 Christmas Hannukah
====================================
Overall, as in the past, the focus has been on just fixing bugs, more geared
in the later 3.x range. Handling "async for/with" in 3.8+ works better.
Numerous bugs around handling `lambda` with keyword-only and `*` args in the
3.0-3.8 have been fixed. However many still remain.
`binary_expr` and `unary_expr` have been renamed to `bin_op` and
`unary_op` to better correspond the Python AST names.
Some work was done Python 3.7+ to handle `and` better; less was done
along the lines of handling `or`. Much more is needed to improve
parsing stability of 3.7+. More of what was done with `and` needs to
be done with `or` and this will happen first in the "decompyle3"
project.
Later this will probably be extended backwards to handle the 3.6-
versions better. This however comes with a big decompilation speed
penalty. When we redo control flow this should go back to normal, but
for now, accuracy is more important than speed.
Another `assert` transform rule was added. Parser rules to distingish
`try/finally` in 3.8 were added and we are more stringent about what
can be turned into an `assert`. There was some grammar cleanup here
too.
A number of small bugs were fixed, and some administrative changes to
make `make check-short` really be short, but check more throughly what
it checks. minimum xdis version needed was bumped to include in the
newer 3.6-3.9 releases. See the `ChangeLog` for details.
3.6.0: 2019-12-10 gecko gecko
=============================
The main focus in this release was more accurate decompilation especially
for 3.7 and 3.8. However there are some improvments to Python 2.x as well,
including one of the long-standing problems of detecting the difference between
`try ... ` and `try else ...`.
With this release we now rebase Python 3.7 on off of a 3.7 base; This
is also as it is (now) in decompyle3. This facilitates removing some of the
cruft in control-flow detection in the 2.7 uncompyle2 base.
Alas, decompilation speed for 3.7 on is greatly increased. Hopefull
this is temporary (cough, cough) until we can do a static control flow
pass.
Finally, runing in 3.9-dev is tolerated. We can disassemble, but no parse tables yet.
3.5.1 2019-11-17 JNC
====================
- Pypy 3.3, 3.5, 3.6, and 3.6.9 support
- bump xdis version to handle newer Python releases, e.g. 2.7.17, 3.5.8, and 3.5.9
- Improve 3.0 decompilation
- no parse errors on stlib bytecode. However accurate translation in
control-flow and and/or detection needs work
- Remove extraneous iter() in "for" of list comprehension Fixes #272
- "for" block without a `POP_BLOCK `and confusing `JUMP_BACK` for `CONTINUE`. Fixes #293
- Fix unmarshal incompletness detected in Pypy 3.6
- Miscellaneous bugs fixed
3.5.0 2019-10-12 Stony Brook Ride
=================================
- Fix fragment bugs
* missing `RETURN_LAST` introduced when adding transformation layer
* more parent entries on tokens
- Preliminary support for decompiling Python 1.0, 1.1, 1.2, and 1.6
* Newer _xdis_ version needed
3.4.1 2019-10-02
================
- Correct assert{,2} transforms Fixes #289
- Fragment parsing fixes:
* Wasn't handling 3-arg `%p`
* fielding error in `code_deparse()`
- Use newer _xdis_ to better track Python 3.8.0
3.4.0 2019-08-24 Totoro
=======================
The main change is to add a tree-transformation phase. This simplifies the
code a little and allows us to turn `if ...: raise AssertionError` into
`assert`, and many `if ..: else if ...` into `if ... elif ..`
Use options `--show=before` and `--show=after` to see the before the tree transformation phase and after the tree transformation phase.
Most of the heavy lifting for this was done by x0ret.
Other changes:
- Fix issue #275, #283 (process to fix this bug is documented on wiki), #284
- blacken more code
- CircleCI adjustments for a changing CircleCi
- Require more recent `xdis` for Python 3.8
- Fix bugs in code using `BUILD_LIST_UNPACK` and variants
3.3.5 2019-07-03 Pre Independence Day
=====================================
Again, most of the work in this is release is thanks to x0ret.
- Handle annotation arguments in Python 3.x
- Fix _vararg_ and function signatures in 3.x
- Some 3.x < 3.6 `while` (1)/`if` fixes &mdash; others remain
- Start reinstating `else if` -> `elif`
- `LOAD_CONST` -> `LOAD_CODE` where appropriate
- option `--weak-verify` is now `--syntax-verify`
- code cleanups, start using [black](https://github.com/python/black) to reformat text
3.3.4 2019-06-19 Fleetwood at 65
================================
Most of the work in this is release is thanks to x0ret.
- Major work was done by x0ret to correct function signatures and include annotation types
- Handle Python 3.6 `STORE_ANNOTATION` [#58](https://github.com/rocky/python-uncompyle6/issues/58)
- Friendlier assembly output
- `LOAD_CONST` replaced by `LOAD_STR` where appropriate to simplify parsing and improve clarity
- remove unneeded parenthesis in a generator expression when it is the single argument to the function [#247](https://github.com/rocky/python-uncompyle6/issues/246)
- Bug in noting an async function [#246](https://github.com/rocky/python-uncompyle6/issues/246)
- Handle Unicode docstrings and fix docstring bugs [#241](https://github.com/rocky/python-uncompyle6/issues/241)
- Add short option -T as an alternate for --tree+
- Some grammar cleanup
3.3.3 2019-05-19 Henry and Lewis
================================
As before, decomplation bugs fixed. The focus has primarily been on
Python 3.7. But with this release, releases will be put on hold,as a
better control-flow detection is worked on . This has been needed for a
while, and is long overdue. It will probably also take a while to get
done as good as what we have now.
However this work will be done in a new project
[decompyle3](https://github.com/rocky/python-decompile3). In contrast
to _uncompyle6_ the code will be written assuming a modern Python 3,
e.g. 3.7. It is originally intended to decompile Python version 3.7
and greater.
* A number of Python 3.7+ chained comparisons were fixed
* Revise Python 3.6ish format string handling
* Go over operator precedence, e.g. for AST `IfExp`
Reported Bug Fixes
------------------
* [#239: 3.7 handling of 4-level attribute import](https://github.com/rocky/python-uncompyle6/issues/239),
* [#229: Inconsistent if block in python3.6](https://github.com/rocky/python-uncompyle6/issues/229),
* [#227: Args not appearing in decompiled src when kwargs is specified explicitly (call_ex_kw)](https://github.com/rocky/python-uncompyle6/issues/227)
2.7 confusion around "and" versus comprehension "if"
* [#225: 2.7 confusion around "and" vs comprehension "if"](https://github.com/rocky/python-uncompyle6/issues/225)
3.3.2 2019-05-03 Better Friday
==============================
As before, lots of decomplation bugs fixed. The focus has primarily
been on Python 3.6. We can now parse the entire 3.6.8 Python library
and verify that without an error. The same is true for 3.5.8. A number
of the bugs fixed though are not contained to these versions. In fact
some span back as far as 2.x
But as before, many more remain in the 3.7 and 3.8 range which will
get addressed in future releases
Pypy 3.6 support was started. Pypy 3.x detection fixed (via `xdis`)
3.3.1 2019-04-19 Good Friday
==========================
Lots of decomplation bugs, especially in the 3.x series fixed. Don't worry though, many more remain.
* Add annotation return values in 3.6+
* Fix 3.6+ lambda parameter handling decompilation
* Fix 3.7+ chained comparison decompilation
* split out semantic-action customization into more separate files
* Add 3.8 try/else
* Fix 2.7 generator decompilation
* Fix some parser failures fixes in 3.4+ using test_pyenvlib
* Add more run tests
3.3.0 2019-04-14 Holy Week
==========================
* First cut at Python 3.8 (many bug remain)
* The usual smattering of bug and doc fixes
3.2.6 2019-03-23 Mueller Report
=======================================
@@ -6,23 +314,25 @@ Mostly more of the same: bug fixes and pull requests.
Bug Fixes
-----------
* [#155: Python 3.x bytecode confusing "try/else" with "try" in a loop](https://github.com/rocky/python-uncompyle6/issues/155),
* [#200: Python 3 bug in not detecting end bounds of an "if" ... "elif"](https://github.com/rocky/python-uncompyle6/issues/200),
* [#208: Comma placement in 3.6 and 3.7 **kwargs](https://github.com/rocky/python-uncompyle6/issues/208),
* [#209: Fix "if" return boundary in 3.6+](https://github.com/rocky/python-uncompyle6/issues/209),
* [#221: Wrong grammar for nested ifelsestmt (in Python 3.7 at least)](https://github.com/rocky/python-uncompyle6/issues/221)
* [#215: 2.7 can have two JUMP_BACKs at the end of a while loop](https://github.com/rocky/python-uncompyle6/issues/215)
* [#209: Fix "if" return boundary in 3.6+](https://github.com/rocky/python-uncompyle6/issues/209),
* [#208: Comma placement in 3.6 and 3.7 **kwargs](https://github.com/rocky/python-uncompyle6/issues/208),
* [#200: Python 3 bug in not detecting end bounds of an "if" ... "elif"](https://github.com/rocky/python-uncompyle6/issues/200),
* [#155: Python 3.x bytecode confusing "try/else" with "try" in a loop](https://github.com/rocky/python-uncompyle6/issues/155),
Pull Requests
----------------
* [#202: Better "assert" statement detemination in Python 2.7](https://github.com/rocky/python-uncompyle6/pull/211)
* [#202: Better "assert" statement determination in Python 2.7](https://github.com/rocky/python-uncompyle6/pull/211)
* [#204: Python 3.7 testing](https://github.com/rocky/python-uncompyle6/pull/204)
* [#205: Run more f-string tests on Python 3.7](https://github.com/rocky/python-uncompyle6/pull/205)
* [#211: support utf-8 chars in Python 3 sourcecode](https://github.com/rocky/python-uncompyle6/pull/202)
3.2.5 2018-12-30 Clearout sale
3.2.5 2018-12-30 Clear-out sale
======================================
- 3.7.2 Remove deprecation warning on regexp string that isn't raw
@@ -57,7 +367,7 @@ Pull Requests
- Add rudimentary 1.4 support (still a bit buggy)
- add --tree+ option to show formatting rule, when it is constant
- Python 2.7.15candidate1 support (via xdis)
- Python 2.7.15candidate1 support (via `xdis`)
- bug fixes, especially for 3.7 (but 2.7 and 3.6 and others as well)
3.1.3 2018-04-16
@@ -87,14 +397,14 @@ Jesus on Friday's New York Times puzzle: "I'm stuck on 2A"
- 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
- more run-time testing of decompiled code
- more removal of parenthesis around calls via setting precedence
3.1.0 2018-03-21 Equinox
==============================
- Add code_deparse_with_offset() fragment function.
- Correct paramenter call fragment deparse_code()
- Correct parameter 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.
@@ -162,24 +472,24 @@ function calls and definitions.
2.15.1 2018-01-27
=====================
- Add --linemap option to give line correspondences
- Add `--linemap` option to give line correspondences
between original source lines and reconstructed line sources.
It is far from perfect, but it is a start
- Add a new class of tests: tests which when decompiled check themselves
- Split off Python version semantic action customizations into its own file
- Fix 2.7 bug in ifelse loop statement
- Handle 3.6+ EXTENDED_ARGs for POP_JUMP_IF... instructions
- Correct 3.6+ calls with kwargs
- Fix 2.7 bug in `if`/`else` loop statement
- Handle 3.6+ `EXTENDED_ARG`s for `POP_JUMP_IF..` instructions
- Correct 3.6+ calls with `kwargs`
- Describe the difficulty of 3.6 in README
2.14.3 2018-01-19
=====================
- Fix bug in 3.5+ await stmt
- Fix bug in 3.5+ `await` statement
- Better version to magic handling; handle 3.5.2 .. 3.5.4 versions
- Improve/correct test_pyenvlib.py status messages
- Fix some 2.7 and 2.6 parser bugs
- Fix whilelse parsing bugs
- Fix `whilelse` parsing bugs
- Correct 2.5- decorator parsing
- grammar for decorators matches AST a little more
- better tests in setup.py for running the right version of Python
@@ -190,15 +500,15 @@ function calls and definitions.
Decompilation bug fixes, mostly 3.6 and pre 2.7
- 3.6 FUNCTION_EX (somewhat)
- 3.6 FUNCTION_EX_KW fixes
- 3.6 MAKE_FUNCTION fixes
- correct 3.5 CALL_FUNCTION_VAR
- 3.6 `FUNCTION_EX` (somewhat)
- 3.6 `FUNCTION_EX_KW` fixes
- 3.6 `MAKE_FUNCTION` fixes
- correct 3.5 `CALL_FUNCTION_VAR`
- stronger 3.x "while 1" testing
- Fix bug in if's with "pass" bodies. Fixes #104
- try/else and try/finally fixes on 2.6-
- limit pypy customization to pypy
- Add addr fields in COME_FROMS
- Add addr fields in `COME_FROM`S
- Allow use of full instructions in parser reduction routines
- Reduce grammar in Python 3 by specialization more to specific
Python versions
@@ -207,11 +517,11 @@ Decompilation bug fixes, mostly 3.6 and pre 2.7
2.14.1 2017-12-10 Dr. Gecko
===================================
- Many decompilation bugfixes
- Many decompilation bug fixes
- Grammar rule reduction and version isolation
- Match higher-level nonterminal names more closely
with Python AST
- Start automated Python stdlib testing - full round trip
- Start automated Python _stdlib_ testing &mdash; full round trip
2.14.0 2017-11-26 johnnybamazing
=========================================
@@ -220,7 +530,7 @@ Decompilation bug fixes, mostly 3.6 and pre 2.7
and remove used grammar rules
- Fix a number of bytecode decompile problems
(many more remain)
- Add stdlib/runtests.sh for even more rigorous testing
- Add `stdlib/runtests.sh` for even more rigorous testing
2.13.3 2017-11-13
=====================
@@ -236,16 +546,16 @@ Overall: better 3.6 decompiling and some much needed code refactoring and cleanu
rather trying to parse the bytecode array. This largely been done in for versions 3.x;
3.0 custom mangling code has been reduced;
some 2.x conversion has been done, but more is desired. This make it possible to...
- Handle EXTENDED_ARGS better. While relevant to all Python versions it is most noticeable in
version 3.6+ where in switching to wordcodes the size of operands has been reduced from 2**16
to 2**8. JUMP instruction then often need EXTENDED_ARGS.
- Handle `EXTENDED_ARGS` better. While relevant to all Python versions it is most noticeable in
version 3.6+ where in switching to wordcodes the size of operands has been reduced from 2^16
to 2^8. `JUMP` instruction then often need EXTENDED_ARGS.
- Refactor find_jump_targets() with via working of of instructions rather the bytecode array.
- use --weak-verify more and additional fuzzing on verify()
- use `--weak-verify` more and additional fuzzing on verify()
- fragment parser now ignores errors in nested function definitions; an parameter was
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 via import Queue
- Distinguish `RETURN_VALUE` from `RETURN_END_IF` in exception bodies better in 3.6
- 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
@@ -265,12 +575,12 @@ Overall: better 3.6 decompiling and some much needed code refactoring and cleanu
- Fixes in deparsing lambda expressions
- Improve table-semantics descriptions
- Document hacky customize arg count better (until we can remove it)
- Update to use xdis 3.7.0 or greater
- Update to use `xdis` 3.7.0 or greater
2.12.0 2017-09-26
=====================
- Use xdis 3.6.0 or greater now
- Use `xdis` 3.6.0 or greater now
- Small semantic table cleanups
- Python 3.4's terms a little names better
- Slightly more Python 3.7, but still failing a lot
@@ -284,13 +594,13 @@ Overall: better 3.6 decompiling and some much needed code refactoring and cleanu
2.11.4 2017-08-15
=====================
* scanner and parser now allow 3-part version string lookups,
* scanner and parser now allow 3-part version string look ups,
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 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".
* 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
semantic routines. We need "is not".
* Some PyPy tolerance in validate testing.
* Some pyston tolerance
@@ -300,15 +610,15 @@ Overall: better 3.6 decompiling and some much needed code refactoring and cleanu
Very minor changes
- RsT doc fixes and updates
- use newer xdis, but not too new; 3.5.2 breaks uncompyle6
- use xdis opcode sets
- xdis "exception match" is now "exception-match"
- use newer `xdis`, but not too new; 3.5.2 breaks uncompyle6
- use `xdis` opcode sets
- `xdis` "exception match" is now "exception-match"
2.11.2 2017-07-09
=====================
- Start supporting Pypy 3.5 (5.7.1-beta)
- use xdis 3.5.0's opcode sets and require xdis 3.5.0
- use `xdis` 3.5.0's opcode sets and require `xdis` 3.5.0
- Correct some Python 2.4-2.6 loop detection
- guard against badly formatted bytecode
@@ -316,55 +626,55 @@ Very minor changes
=====================
- Python 3.x annotation and function signature fixes
- Bump xdis version
- Small pysource bug fixes
- Bump `xdis` version
- Small `pysource.py` bug fixes
2.11.0 2017-06-18 Fleetwood
==================================
- Major improvements in fragment tracking
* Add nonterminal node in extractInfo
* Add nonterminal node in `extractInfo()`
* tag more offsets in expressions
* tag array subscripts
* set YIELD value offset in a <yield> expr
* set `YIELD` value offset in a _yield expr_
* fix a long-standing bug in not adjusting final AST when melding other deparse ASTs
- Fixes yet again for make_function node handling; document what's up here
- Fix bug in snowflake Python 3.5 *args kwargs
- Fix bug in snowflake Python 3.5 `*args`, `kwargs`
2.10.1 2017-06-3 Marylin Frankel
========================================
- fix some fragments parsing bugs
- was returning the wrong type sometimes in deparse_code_around_offset()
- was returning the wrong type sometimes in `deparse_code_around_offset()`
- capture function name in offsets
- track changes to ifelstrmtr node from pysource into fragments
- track changes to `ifelstrmtr` node from `pysource.py` into fragments
2.10.0 2017-05-30 Elaine Gordon
=======================================
- Add fuzzy offset deparse look up
- 3.6 bug fixes
- fix EXTENDED_ARGS handling (and in 2.6 and others)
- fix `EXTENDED_ARGS` handling (and in 2.6 and others)
- semantic routine make_function fragments.py
- MAKE_FUNCTION handling
- CALL_FUNCTION_EX handling
- async property on defs
- support for CALL_FUNCTION_KW (moagstar)
- 3.5+ UNMAP_PACK and BUILD_UNMAP_PACK handling
- `MAKE_FUNCTION` handling
- `CALL_FUNCTION_EX` handling
- `async` property on `defs`
- support for `CALL_FUNCTION_KW` (moagstar)
- 3.5+ `UNMAP_PACK` and` BUILD_UNMAP_PACK` handling
- 3.5 FUNCTION_VAR bug
- 3.x pass statement insdie while True
- 3.x pass statement inside `while True`
- Improve 3.2 decompilation
- Fixed -o argument processing (grkov90)
- Fixed `-o` argument processing (grkov90)
- Reduce scope of LOAD_ASSERT as expr to 3.4+
- "await" statement fixes
- `await` statement fixes
- 2.3, 2.4 "if 1 .." fixes
- 3.x annotation fixes
2.9.11 2017-04-06
=====================
- Better support for Python 3.5+ BUILD_MAP_UNPACK
- Start 3.6 CALL_FUNCTION_EX support
- Better support for Python 3.5+ `BUILD_MAP_UNPACK`
- Start 3.6 `CALL_FUNCTION_EX` support
- Many decompilation bug fixes. (Many more remain). See ChangeLog
2.9.10 2017-02-25
@@ -372,7 +682,7 @@ Very minor changes
- Python grammar rule fixes
- Add ability to get grammar coverage on runs
- Handle Python 3.6 opcode BUILD_CONST_KEYMAP
- Handle Python 3.6 opcode `BUILD_CONST_KEYMAP`
2.9.9 2016-12-16
@@ -388,13 +698,13 @@ Very minor changes
====================
- Better control-flow detection
- pseudo instruction THEN in 2.x
- pseudo instruction `THEN` in 2.x
to disambiguate if from and
- fix bug in --verify option
- fix bug in `--verify` option
- DRY (a little) control-flow detection
- fix syntax in tuples with one element
- if AST rule inheritance in Python 2.5
- NAME_MODULE removal for Python <= 2.4
- `NAME_MODULE` removal for Python <= 2.4
- verify call fixes for Python <= 2.4
- more Python lint
@@ -405,9 +715,9 @@ Very minor changes
- Some Python 3.6 bytecode to wordcode conversion fixes
- option -g: show start-end range when possible
- track print_docstring move to help (used in python 3.1)
- verify: allow RETURN_VALUE to match RETURN_END_IF
- verify: allow `RETURN_VALUE` to match `RETURN_END_IF`
- some 3.2 compatibility
- Better Python 3 control flow detection by adding Pseudo ELSE opcodes
- Better Python 3 control flow detection by adding Pseudo `ELSE` opcodes
2.9.6 2016-12-04
====================
@@ -423,7 +733,7 @@ Very minor changes
- Correct MANIFEST.in
- More AST grammar checking
- --linemapping option or linenumbers.line_number_mapping()
- `--linemapping` option or _linenumbers.line_number_mapping()_
Shows correspondence of lines between source
and decompiled source
- Some control flow adjustments in code for 2.x.
@@ -443,7 +753,7 @@ Very minor changes
* improper while 1 else
* docstring indent
* 3.3 default values in lambda expressions
* start 3.0 decompilation (needs newer xdis)
* start 3.0 decompilation (needs newer `xdis`)
- Start grammar misparse checking
@@ -457,12 +767,12 @@ Very minor changes
2.9.3 2016-10-26
====================
Release forced by incompatibility change in xdis 3.2.0.
Release forced by incompatibility change in` xdis` 3.2.0.
- Python 3.1 bugs:
* handle "with ... as"
* handle "with"
* Start handling def (...) -> yy (has bugs still)
* handle `with`... `as`
* handle `with`
* Start handling `def` (...) -> _yy_ (has bugs still)
- DRY Python 3.x via inheritance
- Python 3.6 work (from Daniel Bradburn)
@@ -488,12 +798,12 @@ Release forced by incompatibility change in xdis 3.2.0.
2.9.0 2016-10-09
====================
- Use xdis 3.0.0 protocol load_module.
- Use `xdis` 3.0.0 protocol `load_module`.
this Forces change in requirements.txt and _pkg_info_.py
- Start Python 1.5 decompiling; another round of work is needed to
remove bugs
- Simplify python 2.1 grammar
- Fix bug with -t ... Wasn't showing source text when -t option was given
- Fix bug with `-t` ... Wasn't showing source text when `-t` option was given
- Fix 2.1-2.6 bug in list comprehension
2.8.4 2016-10-08
@@ -502,8 +812,8 @@ Release forced by incompatibility change in xdis 3.2.0.
- Python 3 disassembly bug fixes
- Python 3.6 fstring bug fixes (from moagstar)
- Python 2.1 disassembly
- COME_FROM suffixes added in Python3
- use .py extension in verification disassembly
- `COME_FROM` suffixes added in Python3
- use `.py` extension in verification disassembly
2.8.3 2016-09-11 live from NYC!
=======================================
@@ -548,8 +858,8 @@ control-flow structure detection is done.
- Add Python 2.2 decompilation
- Fix bugs
* PyPy LOOKUP_METHOD bug
* Python 3.6 FORMAT_VALUE handles expressions now
* PyPy `LOOKUP_METHOD` bug
* Python 3.6 `FORMAT_VALUE` handles expressions now
2.8.0 2016-08-03
====================
@@ -599,7 +909,7 @@ control-flow structure detection is done.
====================
- Improve Python 2.6 bytecode deparsing:
stdlib now will deparse something
_stdlib_ now will deparse something
- Better <2.6 vs. 2.7 grammar separation
- Fix some 2.7 deparsing bugs
- Fix bug in installing uncompyle6 script
@@ -662,9 +972,9 @@ control-flow structure detection is done.
2.3.2 2016-05-1
===================
- Add --version option standalone scripts
- Add `--version` option standalone scripts
- Correct License information in package
- expose fns uncompyle_file, load_file, and load_module
- expose functions `uncompyle_file()`, `load_file()`, and `load_module()`
- Start to DRY Python2 and Python3 grammars Separate out 3.2, and 3.5+
specific grammar code
- Fix bug in 3.5+ constant map parsing
@@ -672,12 +982,12 @@ control-flow structure detection is done.
2.3.0, 2.3.1 2016-04-30
=============================
- Require spark_parser >= 1.1.0
- Require `spark_parser` >= 1.1.0
2.2.0 2016-04-30
====================
- Spark is no longer here but pulled separate package spark_parse
- Spark is no longer here but pulled separate package [spark_parser](https://pypi.org/project/spark_parser/)
- Python 3 parsing fixes
- More tests
@@ -687,7 +997,7 @@ control-flow structure detection is done.
- Support single-mode (in addition to exec-mode) compilation
- Start to DRY Python 2 and Python 3 grammars
- Fix bug in if else ternary construct
- Fix bug in uncomplye6 -d and -r options (via lelicopter)
- Fix bug in uncomplye6 `-d` and `-r` options (via lelicopter)
2.1.3 2016-01-02
@@ -695,7 +1005,7 @@ control-flow structure detection is done.
- Limited support for decompiling Python 3.5
- Improve Python 3 class deparsing
- Handle MAKE_CLOSURE opcode
- Handle `MAKE_CLOSURE` opcode
- Start to DRY opcode code.
- increase test coverage
- fix misc small bugs and some improvements
@@ -737,5 +1047,5 @@ Changes from uncompyle2
SPARK:
add option to show grammar rules applied
allow Python-style # comments in grammar
allow Python-style `#` comments in grammar
Runs on Python 3 and Python 2

View File

@@ -1,4 +1,6 @@
|buildstatus| |Latest Version| |Supported Python Versions|
|buildstatus| |Pypi Installs| |Latest Version| |Supported Python Versions|
|packagestatus|
uncompyle6
==========
@@ -11,9 +13,9 @@ Introduction
------------
*uncompyle6* translates Python bytecode back into equivalent Python
source code. It accepts bytecodes from Python version 1.3 to version
3.7, spanning over 22 years of Python releases. We include Dropbox's
Python 2.5 bytecode and some PyPy bytecode.
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?
---------
@@ -44,14 +46,15 @@ not exist and there is just bytecode. Again, my debuggers make use of
this.
There were (and still are) a number of decompyle, uncompyle,
uncompyle2, uncompyle3 forks around. Almost all of them come basically
from the same code base, and (almost?) all of them are no longer
actively maintained. One was really good at decompiling Python 1.5-2.3
or so, another really good at Python 2.7, but that only. Another
handles Python 3.2 only; another patched that and handled only 3.3.
You get the idea. This code pulls all of these forks together and
*moves forward*. There is some serious refactoring and cleanup in this
code base over those old forks.
uncompyle2, uncompyle3 forks around. Many of them come basically from
the same code base, and (almost?) all of them are no longer actively
maintained. One was really good at decompiling Python 1.5-2.3, another
really good at Python 2.7, but that only. Another handles Python 3.2
only; another patched that and handled only 3.3. You get the
idea. This code pulls all of these forks together and *moves
forward*. There is some serious refactoring and cleanup in this code
base over those old forks. Even more experimental refactoring is going
on in decompile3_.
This demonstrably does the best in decompiling Python across all
Python versions. And even when there is another project that only
@@ -73,11 +76,11 @@ fixed in the other decompilers.
Requirements
------------
The code here can be run on Python versions 2.6 or later, PyPy 3-2.4,
or PyPy-5.0.1. Python versions 2.4-2.7 are supported in the
python-2.4 branch. The bytecode files it can read have been tested on
Python bytecodes from versions 1.4, 2.1-2.7, and 3.0-3.6 and the
above-mentioned PyPy versions.
The code here can be run on Python versions 2.6 or later, PyPy 3-2.4
and later. Python versions 2.4-2.7 are supported in the python-2.4
branch. 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
------------
@@ -86,19 +89,18 @@ This uses setup.py, so it follows the standard Python routine:
::
pip install -e . # set up to run from source tree
# Or if you want to install instead
python setup.py install # may need sudo
$ 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.
Testing
-------
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.
@@ -122,16 +124,39 @@ For usage help:
$ uncompyle6 -h
If you want strong verification of the correctness of the
decompilation process, add the `--verify` option. But there are
situations where this will indicate a failure, although the generated
program is semantically equivalent. Using option `--weak-verify` will
tell you if there is something definitely wrong. Generally, large
swaths of code are decompiled correctly, if not the entire program.
Verification
------------
You can also cross compare the results with pycdc_ . Since they work
differently, bugs here often aren't in that, and vice versa.
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 either another version of
`uncompyle6` since there are are sometimes regressions in decompiling
specific bytecode as the overall quality improves.
For Python 3.7 and above, 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
-----------------------
@@ -146,27 +171,6 @@ 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.
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.
There 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.
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
python 2.3-2.4 since a lot of the goodness of early the version of the
@@ -182,20 +186,30 @@ In the Python 3 series, Python support is is strongest around 3.4 or
3.0 is weird in that it in some ways resembles 2.6 more than it does
3.1 or 2.7. Python 3.6 changes things drastically by using word codes
rather than byte codes. As a result, the jump offset field in a jump
instruction argument has been reduced. This makes the `EXTENDED_ARG`
instruction argument has been reduced. This makes the :code:`EXTENDED_ARG`
instructions are now more prevalent in jump instruction; previously
they had been rare. Perhaps to compensate for the additional
`EXTENDED_ARG` instructions, additional jump optimization has been
: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 and 3.7 there have been major changes to the
`MAKE_FUNCTION` and `CALL_FUNCTION` instructions.
Between Python 3.5, 3.6, 3.7 there have been major changes to the
:code:`MAKE_FUNCTION` and :code:`CALL_FUNCTION` instructions. Python
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 the released
magic. There are also customized Python interpreters, notably Dropbox,
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 bytcode. With the exception of
the Dropbox's old Python 2.5 interpreter this kind of thing is not
handled.
@@ -215,29 +229,33 @@ There is lots to do, so please dig in and help.
See Also
--------
* https://github.com/zrax/pycdc : purports to support all versions of Python. It is written in C++ and is most accurate for Python versions around 2.7 and 3.3 when the code was more actively developed. Accuracy for more recent versions of Python 3 and early versions of Python are especially lacking. See its `issue tracker <https://github.com/zrax/pycdc/issues>`_ for details. Currently lightly maintained.
* https://github.com/rocky/python-decompile3 : Much smaller and more modern code, focusing on 3.7+. Changes in that will get migrated back ehre.
* 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.
* https://github.com/wibiti/uncompyle2 : supports Python 2.7 only, but does that fairly well. There are situtations where `uncompyle6` results are incorrect while `uncompyle2` results are not, but more often uncompyle6 is correct when uncompyle2 is not. Because `uncompyle6` adheres to accuracy over idiomatic Python, `uncompyle2` can produce more natural-looking code when it is correct. Currently `uncompyle2` is lightly maintained. See its issue `tracker <https://github.com/wibiti/uncompyle2/issues>`_ for more details
* https://github.com/wibiti/uncompyle2 : supports Python 2.7 only, but does that fairly well. There are situations where :code:`uncompyle6` results are incorrect while :code:`uncompyle2` results are not, but more often uncompyle6 is correct when uncompyle2 is not. Because :code:`uncompyle6` adheres to accuracy over idiomatic Python, :code:`uncompyle2` can produce more natural-looking code when it is correct. Currently :code:`uncompyle2` is lightly maintained. See its issue `tracker <https://github.com/wibiti/uncompyle2/issues>`_ for more details
* `How to report a bug <https://github.com/rocky/python-uncompyle6/blob/master/HOW-TO-REPORT-A-BUG.md>`_
* The HISTORY_ file.
* https://github.com/rocky/python-xdis : Cross Python version disassembler
* https://github.com/rocky/python-xasm : Cross Python version assembler
* https://github.com/rocky/python-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. It 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.
.. _trepan: https://pypi.python.org/pypi/trepan2
.. _trepan: https://pypi.python.org/pypi/trepan2g
.. _compiler: https://pypi.python.org/pypi/spark_parser
.. _HISTORY: https://github.com/rocky/python-uncompyle6/blob/master/HISTORY.md
.. _debuggers: https://pypi.python.org/pypi/trepan3k
.. _remake: https://bashdb.sf.net/remake
.. _pycdc: https://github.com/zrax/pycdc
.. _decompyle3: https://github.com/rocky/python-decompile3
.. _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
.. |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
.. _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

View File

@@ -1,4 +1,4 @@
# Copyright (C) 2018 Rocky Bernstein <rocky@gnu.org>
# Copyright (C) 2018, 2020 Rocky Bernstein <rocky@gnu.org>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -23,48 +23,49 @@
# Things that change more often go here.
copyright = """
Copyright (C) 2015-2018 Rocky Bernstein <rb@dustyfeet.com>.
Copyright (C) 2015-2020 Rocky Bernstein <rb@dustyfeet.com>.
"""
classifiers = ['Development Status :: 5 - Production/Stable',
'Intended Audience :: Developers',
'License :: OSI Approved :: GNU General Public License v3 (GPLv3)',
'Operating System :: OS Independent',
'Programming Language :: Python',
'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',
'Topic :: Software Development :: Debuggers',
'Topic :: Software Development :: Libraries :: Python Modules',
classifiers = ["Development Status :: 5 - Production/Stable",
"Intended Audience :: Developers",
"License :: OSI Approved :: GNU General Public License v3 (GPLv3)",
"Operating System :: OS Independent",
"Programming Language :: Python",
"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",
"Topic :: Software Development :: Debuggers",
"Topic :: Software Development :: Libraries :: Python Modules",
]
# The rest in alphabetic order
author = "Rocky Bernstein, Hartmut Goebel, John Aycock, and others"
author_email = "rb@dustyfeet.com"
entry_points = {
'console_scripts': [
'uncompyle6=uncompyle6.bin.uncompile:main_bin',
'pydisassemble=uncompyle6.bin.pydisassemble:main',
"console_scripts": [
"uncompyle6=uncompyle6.bin.uncompile:main_bin",
"pydisassemble=uncompyle6.bin.pydisassemble:main",
]}
ftp_url = None
install_requires = ['spark-parser >= 1.8.7, < 1.9.0',
'xdis >= 3.9.0, < 3.10.0']
install_requires = ["spark-parser >= 1.8.9, < 1.9.0",
"xdis >= 4.2.2, < 4.3.0"]
license = 'GPL3'
mailing_list = 'python-debugger@googlegroups.com'
modname = 'uncompyle6'
license = "GPL3"
mailing_list = "python-debugger@googlegroups.com"
modname = "uncompyle6"
py_modules = None
short_desc = 'Python cross-version byte-code decompiler'
web = 'https://github.com/rocky/python-uncompyle6/'
short_desc = "Python cross-version byte-code decompiler"
web = "https://github.com/rocky/python-uncompyle6/"
# tracebacks in zip files are funky and not debuggable
zip_safe = True
@@ -81,5 +82,5 @@ def read(*rnames):
return open(os.path.join(srcdir, *rnames)).read()
# Get info from files; set: long_description and VERSION
long_description = ( read("README.rst") + '\n' )
exec(read('uncompyle6/version.py'))
long_description = ( read("README.rst") + "\n" )
exec(read("uncompyle6/version.py"))

View File

@@ -8,4 +8,15 @@ They are customized to my environment:
- I have git repos for xdis, and spark parser at the same level as uncompyle6
There may be other rocky-specific things that need customization.
how-to-make-a-release.txt has overall how I make a release
how-to-make-a-release.md has overall how I make a release
Since this project uses python over a wide variety of release, some versions
of projects that should be used for specific Python versions
for 3.2.6:
pytest==2.9.2
for 3.1.5
pytset==2.1.0
py=1.8.0 and comment out line 10 of _builtin.py # callable = callable
six==1.10.0

3
admin-tools/check-newer-versions.sh Executable file → Normal file
View File

@@ -21,8 +21,9 @@ for version in $PYVERSIONS; do
exit $?
fi
make clean && pip install -e .
if ! make check; then
if ! make check-short; then
exit $?
fi
echo === $version ===
done
make check

3
admin-tools/check-older-versions.sh Executable file → Normal file
View File

@@ -20,8 +20,9 @@ for version in $PYVERSIONS; do
exit $?
fi
make clean && python setup.py develop
if ! make check ; then
if ! make check-short ; then
exit $?
fi
echo === $version ===
done
make check

View File

@@ -55,19 +55,23 @@
# Make packages and tag
$ . ./admin-tools/make-dist-older.sh
$ pyenv local 3.8.1
$ twine check dist/uncompyle6-$VERSION*
$ git tag release-python-2.4-$VERSION
$ . ./admin-tools/make-dist-newer.sh
$ git tag release-$VERSION
$ twine check dist/uncompyle6-$VERSION*
# Upload single package and look at Rst Formating
$ twine check dist/uncompyle6-${VERSION}*
$ twine upload dist/uncompyle6-${VERSION}-py3.3.egg
# Upload rest of versions
$ twine upload dist/uncompyle6-${VERSION}*
Goto https://github.com/rocky/python-uncompyle6/releases
# Push tags:
$ git push --tags

View 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}*

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.2.6 3.6.8 3.7.2 2.6.9 3.3.7 2.7.15 3.2.6 3.1.5 3.4.8'
export PYVERSIONS='3.5.9 3.6.10 2.6.9 3.3.7 2.7.17 3.2.6 3.1.5 3.4.10 3.7.6 3.8.1'

3
admin-tools/setup-master.sh Executable file → Normal file
View File

@@ -1,5 +1,5 @@
#!/bin/bash
PYTHON_VERSION=3.6.5
PYTHON_VERSION=3.7.6
# FIXME put some of the below in a common routine
function finish {
@@ -20,3 +20,4 @@ cd $fulldir/..
(cd ../python-xdis && git checkout master && pyenv local $PYTHON_VERSION) && git pull && \
git checkout master && pyenv local $PYTHON_VERSION && git pull
cd $owd
rm -v */.python-version || true

2
admin-tools/setup-python-2.4.sh Executable file → Normal file
View File

@@ -14,3 +14,5 @@ cd $fulldir/..
(cd ../python-xdis && git checkout python-2.4 && pyenv local $PYTHON_VERSION) && git pull && \
git checkout python-2.4 && pyenv local $PYTHON_VERSION && git pull
cd $owd
rm -v */.python-version || true
pyenv local $PYTHON_VERSION

3
admin-tools/update-sources.sh Executable file
View File

@@ -0,0 +1,3 @@
#!/bin/bash
cd $(dirname ${BASH_SOURCE[0]})/..
git pull

View File

@@ -61,7 +61,7 @@ build_script:
test_script:
# Run the project tests
- "%CMD_IN_ENV% python test/test_pyenvlib.py --native --weak-verify"
- "%CMD_IN_ENV% python test/test_pyenvlib.py --native --syntax-verify"
after_test:
# If tests are successful, create binary packages for the project.

View File

@@ -1,7 +1,11 @@
PHONY=check test pytest
SHELL=/bin/bash
PYTHON ?= python
#: Run all tests
test check pytest:
py.test
@PYTHON_VERSION=`$(PYTHON) -V 2>&1 | cut -d ' ' -f 2 | cut -d'.' -f1,2`; \
if [[ $$PYTHON_VERSION > 3.2 ]] || [[ $$PYTHON_VERSION == 2.7 ]] || [[ $$PYTHON_VERSION == 2.6 ]]; then \
py.test; \
fi

View File

@@ -30,7 +30,7 @@ def list_comp():
[y for y in range(3)]
def get_parsed_for_fn(fn):
code = fn.__code__ if PYTHON3 else fn.func_code
code = fn.func_code
return deparse(code, version=PYTHON_VERSION)
def check_expect(expect, parsed, fn_name):

View File

@@ -1,78 +0,0 @@
import sys
from uncompyle6 import PYTHON3
if PYTHON3:
from io import StringIO
minint = -sys.maxsize-1
maxint = sys.maxsize
else:
from StringIO import StringIO
minint = -sys.maxint-1
maxint = sys.maxint
from uncompyle6.semantics.helper import print_docstring
class PrintFake():
def __init__(self):
self.pending_newlines = 0
self.f = StringIO()
def write(self, *data):
if (len(data) == 0) or (len(data) == 1 and data[0] == ''):
return
out = ''.join((str(j) for j in data))
n = 0
for i in out:
if i == '\n':
n += 1
if n == len(out):
self.pending_newlines = max(self.pending_newlines, n)
return
elif n:
self.pending_newlines = max(self.pending_newlines, n)
out = out[n:]
break
else:
break
if self.pending_newlines > 0:
self.f.write('\n'*self.pending_newlines)
self.pending_newlines = 0
for i in out[::-1]:
if i == '\n':
self.pending_newlines += 1
else:
break
if self.pending_newlines:
out = out[:-self.pending_newlines]
self.f.write(out)
def println(self, *data):
if data and not(len(data) == 1 and data[0] ==''):
self.write(*data)
self.pending_newlines = max(self.pending_newlines, 1)
return
pass
def test_docstring():
for doc, expect in (
("Now is the time",
' """Now is the time"""'),
("""
Now is the time
""",
''' """
Now is the time
"""''')
# (r'''func placeholder - ' and with ("""\nstring\n """)''',
# """ r'''func placeholder - ' and with (\"\"\"\nstring\n\"\"\")'''"""),
# (r"""func placeholder - ' and with ('''\nstring\n''') and \"\"\"\nstring\n\"\"\" """,
# """ r\"\"\"func placeholder - ' and with ('''\nstring\n''') and \"\"\"\nstring\n\"\"\" \"\"\"""")
):
o = PrintFake()
# print(doc)
# print(expect)
print_docstring(o, ' ', doc)
assert expect == o.f.getvalue()

View File

@@ -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)
if 2.7 <= PYTHON_VERSION <= 3.0 and not IS_PYPY:
scan.build_instructions(code)

View File

@@ -1,154 +0,0 @@
# std
# test
from uncompyle6 import PYTHON_VERSION, deparse_code
import pytest
pytestmark = pytest.mark.skipif(PYTHON_VERSION <= 2.6,
reason='hypothesis needs 2.7 or later')
if PYTHON_VERSION > 2.6:
import hypothesis
from hypothesis import strategies as st
# uncompyle6
@st.composite
def expressions(draw):
# todo : would be nice to generate expressions using hypothesis however
# this is pretty involved so for now just use a corpus of expressions
# from which to select.
return draw(st.sampled_from((
'abc',
'len(items)',
'x + 1',
'lineno',
'container',
'self.attribute',
'self.method()',
# These expressions are failing, I think these are control
# flow problems rather than problems with FORMAT_VALUE,
# however I need to confirm this...
#'sorted(items, key=lambda x: x.name)',
#'func(*args, **kwargs)',
#'text or default',
#'43 if life_the_universe and everything else None'
)))
@st.composite
def format_specifiers(draw):
"""
Generate a valid format specifier using the rules:
format_spec ::= [[fill]align][sign][#][0][width][,][.precision][type]
fill ::= <any character>
align ::= "<" | ">" | "=" | "^"
sign ::= "+" | "-" | " "
width ::= integer
precision ::= integer
type ::= "b" | "c" | "d" | "e" | "E" | "f" | "F" | "g" | "G" | "n" | "o" | "s" | "x" | "X" | "%"
See https://docs.python.org/2/library/string.html
:param draw: Let hypothesis draw from other strategies.
:return: An example format_specifier.
"""
alphabet_strategy = st.characters(min_codepoint=ord('a'), max_codepoint=ord('z'))
fill = draw(st.one_of(alphabet_strategy, st.none()))
align = draw(st.sampled_from(list('<>=^')))
fill_align = (fill + align or '') if fill else ''
type_ = draw(st.sampled_from('bcdeEfFgGnosxX%'))
can_have_sign = type_ in 'deEfFgGnoxX%'
can_have_comma = type_ in 'deEfFgG%'
can_have_precision = type_ in 'fFgG'
can_have_pound = type_ in 'boxX%'
can_have_zero = type_ in 'oxX'
sign = draw(st.sampled_from(list('+- ') + [''])) if can_have_sign else ''
pound = draw(st.sampled_from(('#', '',))) if can_have_pound else ''
zero = draw(st.sampled_from(('0', '',))) if can_have_zero else ''
int_strategy = st.integers(min_value=1, max_value=1000)
width = draw(st.one_of(int_strategy, st.none()))
width = str(width) if width is not None else ''
comma = draw(st.sampled_from((',', '',))) if can_have_comma else ''
if can_have_precision:
precision = draw(st.one_of(int_strategy, st.none()))
precision = '.' + str(precision) if precision else ''
else:
precision = ''
return ''.join((fill_align, sign, pound, zero, width, comma, precision, type_,))
@st.composite
def fstrings(draw):
"""
Generate a valid f-string.
See https://www.python.org/dev/peps/pep-0498/#specification
:param draw: Let hypothsis draw from other strategies.
:return: A valid f-string.
"""
character_strategy = st.characters(
blacklist_characters='\r\n\'\\s{}',
min_codepoint=1,
max_codepoint=1000,
)
is_raw = draw(st.booleans())
integer_strategy = st.integers(min_value=0, max_value=3)
expression_count = draw(integer_strategy)
content = []
for _ in range(expression_count):
expression = draw(expressions())
conversion = draw(st.sampled_from(('', '!s', '!r', '!a',)))
has_specifier = draw(st.booleans())
specifier = ':' + draw(format_specifiers()) if has_specifier else ''
content.append('{{{}{}}}'.format(expression, conversion, specifier))
content.append(draw(st.text(character_strategy)))
content = ''.join(content)
return "f{}'{}'".format('r' if is_raw else '', content)
@pytest.mark.skipif(PYTHON_VERSION != 3.6, reason='need Python 3.6')
@hypothesis.given(format_specifiers())
def test_format_specifiers(format_specifier):
"""Verify that format_specifiers generates valid specifiers"""
try:
exec('"{:' + format_specifier + '}".format(0)')
except ValueError as e:
if 'Unknown format code' not in str(e):
raise
def run_test(text):
hypothesis.assume(len(text))
hypothesis.assume("f'{" in text)
expr = text + '\n'
code = compile(expr, '<string>', 'single')
deparsed = deparse_code(PYTHON_VERSION, code, compile_mode='single')
recompiled = compile(deparsed.text, '<string>', 'single')
if recompiled != code:
assert 'dis(' + deparsed.text.strip('\n') + ')' == 'dis(' + expr.strip('\n') + ')'
@pytest.mark.skipif(PYTHON_VERSION != 3.6, reason='need Python 3.6')
@hypothesis.given(fstrings())
def test_uncompyle_fstring(fstring):
"""Verify uncompyling fstring bytecode"""
run_test(fstring)
@pytest.mark.skipif(PYTHON_VERSION < 3.6, reason='need Python 3.6+')
@pytest.mark.parametrize('fstring', [
"f'{abc}{abc!s}'",
"f'{abc}0'",
])
def test_uncompyle_direct(fstring):
"""useful for debugging"""
run_test(fstring)

View File

@@ -1,185 +0,0 @@
import string
from uncompyle6 import PYTHON_VERSION
import pytest
pytestmark = pytest.mark.skip(PYTHON_VERSION < 2.7,
reason="need at least Python 2.7")
if PYTHON_VERSION > 2.6:
from hypothesis import given, assume, example, settings, strategies as st
from validate import validate_uncompyle
from test_fstring import expressions
alpha = st.sampled_from(string.ascii_lowercase)
numbers = st.sampled_from(string.digits)
alphanum = st.sampled_from(string.ascii_lowercase + string.digits)
@st.composite
def function_calls(draw,
min_keyword_args=0, max_keyword_args=5,
min_positional_args=0, max_positional_args=5,
min_star_args=0, max_star_args=1,
min_double_star_args=0, max_double_star_args=1):
"""
Strategy factory for generating function calls.
:param draw: Callable which draws examples from other strategies.
:return: The function call text.
"""
st_positional_args = st.lists(
alpha,
min_size=min_positional_args,
max_size=max_positional_args
)
st_keyword_args = st.lists(
alpha,
min_size=min_keyword_args,
max_size=max_keyword_args
)
st_star_args = st.lists(
alpha,
min_size=min_star_args,
max_size=max_star_args
)
st_double_star_args = st.lists(
alpha,
min_size=min_double_star_args,
max_size=max_double_star_args
)
positional_args = draw(st_positional_args)
keyword_args = draw(st_keyword_args)
st_values = st.lists(
expressions(),
min_size=len(keyword_args),
max_size=len(keyword_args)
)
keyword_args = [
x + '=' + e
for x, e in
zip(keyword_args, draw(st_values))
]
star_args = ['*' + x for x in draw(st_star_args)]
double_star_args = ['**' + x for x in draw(st_double_star_args)]
arguments = positional_args + keyword_args + star_args + double_star_args
draw(st.randoms()).shuffle(arguments)
arguments = ','.join(arguments)
function_call = 'fn({arguments})'.format(arguments=arguments)
try:
# TODO: Figure out the exact rules for ordering of positional, keyword,
# star args, double star args and in which versions the various
# types of arguments are supported so we don't need to check that the
# expression compiles like this.
compile(function_call, '<string>', 'single')
except:
assume(False)
return function_call
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
particular types of arguments, for example only positional arguments.
This can help reason about debugging errors in specific types of function
calls.
:param which: One of 'keyword', 'positional', 'star', 'double_star'
:return: Strategy for generating an function call isolated to specific
argument types.
"""
kwargs = dict(
max_keyword_args=0,
max_positional_args=0,
max_star_args=0,
max_double_star_args=0,
)
kwargs['_'.join(('min', which, 'args'))] = 1
kwargs['_'.join(('max', which, 'args'))] = 5 if 'star' not in which else 1
return function_calls(**kwargs)
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):
validate_uncompyle(expr)
@pytest.mark.xfail()
def test_BUILD_CONST_KEY_MAP_BUILD_MAP_UNPACK_WITH_CALL_BUILD_TUPLE_CALL_FUNCTION_EX():
validate_uncompyle("fn(w=0,m=0,**v)")
@pytest.mark.xfail()
def test_BUILD_MAP_BUILD_MAP_UNPACK_WITH_CALL_BUILD_TUPLE_CALL_FUNCTION_EX():
validate_uncompyle("fn(a=0,**g)")
@pytest.mark.xfail()
def test_CALL_FUNCTION_EX():
validate_uncompyle("fn(*g,**j)")
@pytest.mark.xfail()
def test_BUILD_MAP_CALL_FUNCTION_EX():
validate_uncompyle("fn(*z,u=0)")
@pytest.mark.xfail()
def test_BUILD_TUPLE_CALL_FUNCTION_EX():
validate_uncompyle("fn(**a)")
@pytest.mark.xfail()
def test_BUILD_MAP_BUILD_TUPLE_BUILD_TUPLE_UNPACK_WITH_CALL_CALL_FUNCTION_EX():
validate_uncompyle("fn(b,b,b=0,*a)")
@pytest.mark.xfail()
def test_BUILD_TUPLE_BUILD_TUPLE_UNPACK_WITH_CALL_CALL_FUNCTION_EX():
validate_uncompyle("fn(*c,v)")
@pytest.mark.xfail()
def test_BUILD_CONST_KEY_MAP_CALL_FUNCTION_EX():
validate_uncompyle("fn(i=0,y=0,*p)")
@pytest.mark.skip(reason='skipping property based test until all individual tests are passing')
@given(function_calls())
def test_function_call(function_call):
validate_uncompyle(function_call)

View File

@@ -1,104 +1,149 @@
import re
from uncompyle6 import PYTHON_VERSION, PYTHON3, IS_PYPY # , PYTHON_VERSION
from uncompyle6 import PYTHON_VERSION, PYTHON3, IS_PYPY # , PYTHON_VERSION
from uncompyle6.parser import get_python_parser, python_parser
from uncompyle6.scanner import get_scanner
def test_grammar():
def test_grammar():
def check_tokens(tokens, opcode_set):
remain_tokens = set(tokens) - opcode_set
remain_tokens = set([re.sub(r'_\d+$','', t) for t in remain_tokens])
remain_tokens = set([re.sub('_CONT$','', t) for t in remain_tokens])
remain_tokens = set([re.sub(r"_\d+$", "", t) for t in remain_tokens])
remain_tokens = set([re.sub("_CONT$", "", t) for t in remain_tokens])
remain_tokens = set([re.sub("LOAD_CODE$", "", t) for t in remain_tokens])
remain_tokens = set(remain_tokens) - opcode_set
assert remain_tokens == set([]), \
"Remaining tokens %s\n====\n%s" % (remain_tokens, p.dump_grammar())
assert remain_tokens == set([]), "Remaining tokens %s\n====\n%s" % (
remain_tokens,
p.dump_grammar(),
)
p = get_python_parser(PYTHON_VERSION, is_pypy=IS_PYPY)
(lhs, rhs, tokens,
right_recursive, dup_rhs) = p.check_sets()
(lhs, rhs, tokens, right_recursive, dup_rhs) = p.check_sets()
# We have custom rules that create the below
expect_lhs = set(['pos_arg', 'get_iter', 'attribute'])
expect_lhs = set(["pos_arg"])
unused_rhs = set(['list', 'mkfunc',
'mklambda',
'unpack',])
expect_right_recursive = set([('designList',
('store', 'DUP_TOP', 'designList'))])
if PYTHON_VERSION < 3.8:
if PYTHON_VERSION < 3.7:
expect_lhs.add("attribute")
if PYTHON_VERSION != 3.7:
unused_rhs.add('call')
expect_lhs.add("get_iter")
if PYTHON_VERSION > 3.7 or PYTHON_VERSION < 3.0:
expect_lhs.add("stmts_opt")
else:
expect_lhs.add("async_with_as_stmt")
expect_lhs.add("async_with_stmt")
unused_rhs = set(["list", "mkfunc", "mklambda", "unpack"])
expect_right_recursive = set([("designList", ("store", "DUP_TOP", "designList"))])
if PYTHON_VERSION <= 3.6:
unused_rhs.add("call")
if PYTHON_VERSION > 2.6:
expect_lhs.add('kvlist')
expect_lhs.add('kv3')
unused_rhs.add('dict')
expect_lhs.add("kvlist")
expect_lhs.add("kv3")
unused_rhs.add("dict")
else:
# NOTE: this may disappear
expect_lhs.add("except_handler_else")
if PYTHON_VERSION < 3.7 and PYTHON_VERSION != 2.7:
# NOTE: this may disappear
expect_lhs.add("except_handler_else")
if PYTHON3:
expect_lhs.add('load_genexpr')
expect_lhs.add("load_genexpr")
unused_rhs = unused_rhs.union(set("""
unused_rhs = unused_rhs.union(
set(
"""
except_pop_except generator_exp
""".split()))
""".split()
)
)
if PYTHON_VERSION >= 3.0:
expect_lhs.add("annotate_arg")
expect_lhs.add("annotate_tuple")
unused_rhs.add("mkfunc_annotate")
if PYTHON_VERSION < 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")
if PYTHON_VERSION >= 3.5:
expect_right_recursive.add((('l_stmts',
('lastl_stmt', 'come_froms', 'l_stmts'))))
pass
elif 3.0 < PYTHON_VERSION < 3.3:
expect_right_recursive.add((('l_stmts',
('lastl_stmt', 'COME_FROM', 'l_stmts'))))
expect_right_recursive.add(
(("l_stmts", ("lastl_stmt", "come_froms", "l_stmts")))
)
pass
pass
pass
else:
expect_lhs.add('kwarg')
expect_lhs.add("kwarg")
# FIXME
if PYTHON_VERSION < 3.8:
assert expect_lhs == set(lhs)
assert unused_rhs == set(rhs)
assert expect_lhs == set(lhs)
assert unused_rhs == set(rhs)
assert expect_right_recursive == right_recursive
expect_dup_rhs = frozenset([('COME_FROM',), ('CONTINUE',), ('JUMP_ABSOLUTE',),
('LOAD_CONST',),
('JUMP_BACK',), ('JUMP_FORWARD',)])
expect_dup_rhs = frozenset(
[
("COME_FROM",),
("CONTINUE",),
("JUMP_ABSOLUTE",),
("LOAD_CONST",),
("JUMP_BACK",),
("JUMP_FORWARD",),
]
)
reduced_dup_rhs = dict((k, dup_rhs[k]) for k in dup_rhs if k not in expect_dup_rhs)
for k in reduced_dup_rhs:
print(k, reduced_dup_rhs[k])
if reduced_dup_rhs:
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
s = get_scanner(PYTHON_VERSION, IS_PYPY)
ignore_set = set(
"""
"""
JUMP_BACK CONTINUE
COME_FROM COME_FROM_EXCEPT
COME_FROM_EXCEPT_CLAUSE
COME_FROM_LOOP COME_FROM_WITH
COME_FROM_FINALLY ELSE
LOAD_GENEXPR LOAD_ASSERT LOAD_SETCOMP LOAD_DICTCOMP
LOAD_GENEXPR LOAD_ASSERT LOAD_SETCOMP LOAD_DICTCOMP LOAD_STR LOAD_CODE
LAMBDA_MARKER
RETURN_END_IF RETURN_END_IF_LAMBDA RETURN_VALUE_LAMBDA RETURN_LAST
""".split())
""".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')
ignore_set.add('STORE_LOCALS')
ignore_set.add("LOAD_CLASSNAME")
ignore_set.add("STORE_LOCALS")
opcode_set = set(s.opc.opname).union(ignore_set)
check_tokens(tokens, opcode_set)
def test_dup_rule():
import inspect
python_parser(PYTHON_VERSION, inspect.currentframe().f_code,
is_pypy=IS_PYPY,
parser_debug={
'dups': True, 'transition': False, 'reduce': False,
'rules': False, 'errorstack': None, 'context': True})
python_parser(
PYTHON_VERSION,
inspect.currentframe().f_code,
is_pypy=IS_PYPY,
parser_debug={
"dups": True,
"transition": False,
"reduce": False,
"rules": False,
"errorstack": None,
"context": True,
},
)

View File

@@ -8,14 +8,10 @@ from uncompyle6.semantics.consts import (
if PYTHON3:
from io import StringIO
def iteritems(d):
return d.items()
else:
from StringIO import StringIO
def iteritems(d):
return d.iteritems()
from uncompyle6.semantics.pysource import SourceWalker as SourceWalker
from uncompyle6.semantics.pysource import (SourceWalker, deparse_code2str)
def test_template_engine():
s = StringIO()
@@ -30,7 +26,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 (
@@ -44,7 +40,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]
@@ -127,11 +123,17 @@ def test_tables():
"Full entry: %s" %
(name, k, arg, typ, entry[arg], type(entry[arg]), entry)
)
assert len(tup) == 2
assert 2 <= len(tup) <= 3
for j, x in enumerate(tup):
assert isinstance(x, int), (
"%s[%s][%d][%d] type '%s' is '%s should be an int but is %s. Full entry: %s" %
(name, k, arg, j, typ, x, type(x), entry)
if len(tup) == 3 and j == 1:
assert isinstance(x, str), (
"%s[%s][%d][%d] type '%s' is '%s should be an string but is %s. Full entry: %s" %
(name, k, arg, j, typ, x, type(x), entry)
)
else:
assert isinstance(x, int), (
"%s[%s][%d][%d] type '%s' is '%s should be an int but is %s. Full entry: %s" %
(name, k, arg, j, typ, x, type(x), entry)
)
pass
arg += 1
@@ -179,3 +181,11 @@ def test_tables():
assert arg == len(entry), (
"%s[%s] arg %d should be length of entry %d. Full entry: %s" %
(name, k, arg, len(entry), entry))
def test_deparse_code2str():
def deparse_test(co):
"This is a docstring"
s = deparse_code2str(co, debug_opts={"asm": "after", "tree": True})
assert s
return
deparse_test(deparse_test.__code__)

View File

@@ -1,7 +1,4 @@
import pytest
from uncompyle6 import PYTHON_VERSION, code_deparse
pytestmark = pytest.mark.skip(PYTHON_VERSION < 2.7,
reason="need at least Python 2.7")
if PYTHON_VERSION > 2.6:
def test_single_mode():

View File

@@ -1,23 +1,25 @@
from uncompyle6 import PYTHON_VERSION
from uncompyle6.scanners.tok import Token
def test_token():
# Test token formatting of: LOAD_CONST None
t = Token('LOAD_CONST', offset=0, attr=None, pattr=None, has_arg=True)
expect = ' 0 LOAD_CONST None'
t = Token("LOAD_CONST", offset=0, attr=None, pattr=None, has_arg=True)
expect = " 0 LOAD_CONST None"
# print(t.format())
assert t
assert t.format() == expect
# Make sure equality testing of tokens ignores offset
t2 = Token('LOAD_CONST', offset=2, attr=None, pattr=None, has_arg=True)
t2 = Token("LOAD_CONST", offset=2, attr=None, pattr=None, has_arg=True)
assert t2 == t
# Make sure formatting of: LOAD_CONST False. We assume False is the 0th index
# of co_consts.
t = Token('LOAD_CONST', offset=1, attr=False, pattr=False, has_arg=True)
expect = ' 1 LOAD_CONST 0 False'
t = Token("LOAD_CONST", offset=1, attr=False, pattr=False, has_arg=True)
expect = " 1 LOAD_CONST False"
assert t.format() == expect
if __name__ == '__main__':
if __name__ == "__main__":
test_token()

View File

@@ -1,12 +1,12 @@
# Python 2.7
# Embedded file name: simple_source/branching/05_if.py
6 0 LOAD_NAME 0 'True'
3 POP_JUMP_IF_FALSE 15 'to 15'
6 0 LOAD_NAME 0 'True'
3 POP_JUMP_IF_FALSE 15 'to 15'
7 6 LOAD_NAME 1 'False'
9 STORE_NAME 2 'b'
12 JUMP_FORWARD 0 'to 15'
15_0 COME_FROM 12 '12'
15 LOAD_CONST 0 None
18 RETURN_VALUE
7 6 LOAD_NAME 1 'False'
9 STORE_NAME 2 'b'
12 JUMP_FORWARD 0 'to 15'
15_0 COME_FROM 12 '12'
15 LOAD_CONST None
18 RETURN_VALUE

View File

@@ -1,15 +1,15 @@
# Python 2.7
# Embedded file name: simple_source/branching/05_ifelse.py
3 0 LOAD_NAME 0 'True'
3 POP_JUMP_IF_FALSE 15 'to 15'
3 0 LOAD_NAME 0 'True'
3 POP_JUMP_IF_FALSE 15 'to 15'
4 6 LOAD_CONST 0 1
9 STORE_NAME 1 'b'
12 JUMP_FORWARD 6 'to 21'
4 6 LOAD_CONST 1
9 STORE_NAME 1 'b'
12 JUMP_FORWARD 6 'to 21'
6 15 LOAD_CONST 1 2
18 STORE_NAME 2 'd'
21_0 COME_FROM 12 '12'
21 LOAD_CONST 2 None
24 RETURN_VALUE
6 15 LOAD_CONST 2
18 STORE_NAME 2 'd'
21_0 COME_FROM 12 '12'
21 LOAD_CONST None
24 RETURN_VALUE

View File

@@ -1,16 +1,20 @@
# future
from __future__ import print_function
# std
import os
import difflib
import subprocess
import tempfile
import functools
# uncompyle6 / xdis
from uncompyle6 import PYTHON_VERSION, PYTHON3, IS_PYPY, deparse_code
from uncompyle6 import PYTHON_VERSION, PYTHON3, IS_PYPY, code_deparse
# TODO : I think we can get xdis to support the dis api (python 3 version) by doing something like this there
from xdis.bytecode import Bytecode
from xdis.main import get_opcode
opc = get_opcode(PYTHON_VERSION, IS_PYPY)
Bytecode = functools.partial(Bytecode, opc=opc)
import six
@@ -20,6 +24,7 @@ if PYTHON3:
else:
from StringIO import StringIO
def _dis_to_text(co):
return Bytecode(co).dis()
@@ -33,36 +38,32 @@ def print_diff(original, uncompyled):
:param original: Text describing the original code object.
:param uncompyled: Text describing the uncompyled code object.
"""
original_lines = original.split('\n')
uncompyled_lines = uncompyled.split('\n')
args = original_lines, uncompyled_lines, 'original', 'uncompyled'
original_lines = original.split("\n")
uncompyled_lines = uncompyled.split("\n")
args = original_lines, uncompyled_lines, "original", "uncompyled"
try:
from bs4 import BeautifulSoup
diff = difflib.HtmlDiff().make_file(*args)
diff = BeautifulSoup(diff, "html.parser")
diff.select_one('table[summary="Legends"]').extract()
except ImportError:
print('\nTo display diff highlighting run:\n pip install BeautifulSoup4')
print("\nTo display diff highlighting run:\n pip install BeautifulSoup4")
diff = difflib.HtmlDiff().make_table(*args)
with tempfile.NamedTemporaryFile(delete=False) as f:
f.write(str(diff).encode('utf-8'))
f.write(str(diff).encode("utf-8"))
try:
print()
html = subprocess.check_output([
'elinks',
'-dump',
'-no-references',
'-dump-color-mode',
'1',
f.name,
]).decode('utf-8')
html = subprocess.check_output(
["elinks", "-dump", "-no-references", "-dump-color-mode", "1", f.name]
).decode("utf-8")
print(html)
except:
print('\nFor side by side diff install elinks')
print("\nFor side by side diff install elinks")
diff = difflib.Differ().compare(original_lines, uncompyled_lines)
print('\n'.join(diff))
print("\n".join(diff))
finally:
os.unlink(f.name)
@@ -80,18 +81,19 @@ def are_instructions_equal(i1, i2):
:return: True if the two instructions are approximately equal, otherwise False.
"""
result = (1==1
result = (
1 == 1
and i1.opname == i2.opname
and i1.opcode == i2.opcode
and i1.arg == i2.arg
# ignore differences due to code objects
# TODO : Better way of ignoring address
and (i1.argval == i2.argval or '<code object' in str(i1.argval))
and (i1.argval == i2.argval or "<code object" in str(i1.argval))
# TODO : Should probably recurse to check code objects
and (i1.argrepr == i2.argrepr or '<code object' in i1.argrepr)
and (i1.argrepr == i2.argrepr or "<code object" in i1.argrepr)
and i1.offset == i2.offset
# ignore differences in line numbers
#and i1.starts_line
# and i1.starts_line
and i1.is_jump_target == i2.is_jump_target
)
return result
@@ -115,22 +117,21 @@ def are_code_objects_equal(co1, co2):
return True
def validate_uncompyle(text, mode='exec'):
def validate_uncompyle(text, mode="exec"):
"""
Validate decompilation of the given source code.
:param text: Source to validate decompilation of.
"""
original_code = compile(text, '<string>', mode)
original_code = compile(text, "<string>", mode)
original_dis = _dis_to_text(original_code)
original_text = text
deparsed = deparse_code(PYTHON_VERSION, original_code,
compile_mode=mode,
out=six.StringIO(),
is_pypy=IS_PYPY)
deparsed = code_deparse(
original_code, out=six.StringIO(), version=PYTHON_VERSION, compile_mode=mode
)
uncompyled_text = deparsed.text
uncompyled_code = compile(uncompyled_text, '<string>', 'exec')
uncompyled_code = compile(uncompyled_text, "<string>", "exec")
if not are_code_objects_equal(uncompyled_code, original_code):
@@ -138,15 +139,17 @@ def validate_uncompyle(text, mode='exec'):
def output(text, dis):
width = 60
return '\n\n'.join([
' SOURCE CODE '.center(width, '#'),
text.strip(),
' BYTECODE '.center(width, '#'),
dis
])
return "\n\n".join(
[
" SOURCE CODE ".center(width, "#"),
text.strip(),
" BYTECODE ".center(width, "#"),
dis,
]
)
original = output(original_text, original_dis)
uncompyled = output(uncompyled_text, uncompyled_dis)
print_diff(original, uncompyled)
assert 'original' == 'uncompyled'
assert "original" == "uncompyled"

View File

@@ -1,2 +1,3 @@
flake8
hypothesis<=3.0.0
six
pytest==3.2.5 # for 2.7 < PYTHON_VERSION <= 3.2 use pytest 2.9.2; for 3.1 2.10

View File

@@ -1,11 +1,11 @@
[bdist_rpm]
release = 1
packager = Mysterie <kajusska@gmail.com>
packager = rocky <rb@dustyfeet.com>
doc_files = README
# CHANGES.txt
# USAGE.txt
# doc/
# examples/
[bdist_wheel]
universal=1
[egg_info]
tag_build =
tag_date = 0

View File

@@ -1,16 +1,16 @@
#!/usr/bin/env python
import sys
"""Setup script for the 'uncompyle6' distribution."""
import sys
SYS_VERSION = sys.version_info[0:2]
if not ((2, 6) <= SYS_VERSION <= (3, 7)):
mess = "Python Release 2.6 .. 3.7 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." %
if not ((2, 4) <= SYS_VERSION <= (2, 7)):
mess = "Python Release 2.4 .. 2.7 are supported in this code branch."
if ((3, 2) <= SYS_VERSION <= (3, 8)):
mess += ("\nFor your Python, version %s, use the master code/branch." %
sys.version[0:3])
elif SYS_VERSION < (2, 4):
mess += ("\nThis package is not supported for Python version %s."
else:
mess += ("\nThis package is not supported before Python 2.4. Your Python version is %s."
% sys.version[0:3])
print(mess)
raise Exception(mess)
@@ -32,6 +32,7 @@ setup(
install_requires = install_requires,
license = license,
long_description = long_description,
long_description_content_type = "text/x-rst",
name = modname,
packages = find_packages(),
py_modules = py_modules,

55
test-unit/test_grammar.py Normal file
View File

@@ -0,0 +1,55 @@
import re
import unittest
from uncompyle6 import PYTHON_VERSION, IS_PYPY # , PYTHON_VERSION
from uncompyle6.parser import get_python_parser, python_parser
class TestGrammar(unittest.TestCase):
def test_grammar(self):
def check_tokens(tokens, opcode_set):
remain_tokens = set(tokens) - opcode_set
remain_tokens = set([re.sub('_\d+$','', t) for t in remain_tokens])
remain_tokens = set([re.sub('_CONT$','', t) for t in remain_tokens])
remain_tokens = set(remain_tokens) - opcode_set
self.assertEqual(remain_tokens, set([]),
"Remaining tokens %s\n====\n%s" % (remain_tokens, p.dump_grammar()))
p = get_python_parser(PYTHON_VERSION, is_pypy=IS_PYPY)
(lhs, rhs, tokens,
right_recursive, dup_rhs) = p.check_sets()
expect_lhs = set(['pos_arg', 'get_iter', 'attribute'])
unused_rhs = set(['list', 'call', 'mkfunc',
'mklambda',
'unpack',])
expect_right_recursive = frozenset([('designList',
('store', 'DUP_TOP', 'designList'))])
expect_lhs.add('kwarg')
self.assertEqual(expect_lhs, set(lhs))
self.assertEqual(unused_rhs, set(rhs))
self.assertEqual(expect_right_recursive, right_recursive)
expect_dup_rhs = frozenset([('COME_FROM',), ('CONTINUE',), ('JUMP_ABSOLUTE',),
('LOAD_CONST',),
('JUMP_BACK',), ('JUMP_FORWARD',)])
reduced_dup_rhs = {}
for k in dup_rhs:
if k not in expect_dup_rhs:
reduced_dup_rhs[k] = dup_rhs[k]
pass
pass
for k in reduced_dup_rhs:
print(k, reduced_dup_rhs[k])
# assert not reduced_dup_rhs, reduced_dup_rhs
def test_dup_rule(self):
import inspect
python_parser(PYTHON_VERSION, inspect.currentframe().f_code,
is_pypy=IS_PYPY,
parser_debug={
'dups': True, 'transition': False, 'reduce': False,
'rules': False, 'errorstack': None, 'context': True})
if __name__ == '__main__':
unittest.main()

2
test/.gitignore vendored
View File

@@ -1 +1,3 @@
/.coverage
/.python-version
/nohup.out

View File

@@ -1,5 +1,6 @@
PHONY=check clean dist distclean test test-unit test-functional rmChangeLog clean_pyc nosetests \
check-bytecode-1 check-bytecode-1.3 check-bytecode-1.4 check-bytecode-1.5 \
check-bytecode-1.0 check-bytecode-1.1 check-bytecode-1.2 check-bytecode-1.3 \
check-bytecode-1 check-bytecode-1.4 check-bytecode-1.5 check-bytecode-1.6 \
check-bytecode-2 check-bytecode-3 check-bytecode-3-short \
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 \
@@ -22,54 +23,59 @@ COVER_DIR=../tmp/grammar-cover
# Run short tests
check-short:
@$(PYTHON) -V && PYTHON_VERSION=`$(PYTHON) -V 2>&1 | cut -d ' ' -f 2 | cut -d'.' -f1,2`; \
$(MAKE) check-bytecode-short
$(MAKE) check-bytecode-$${PYTHON_VERSION}
# Run all tests
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 --weak-verify $(COMPILE)
$(PYTHON) test_pythonlib.py --bytecode-3.0-run --verify-run
$(PYTHON) test_pythonlib.py --bytecode-3.0 --syntax-verify $(COMPILE)
#: 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
$(PYTHON) test_pythonlib.py --bytecode-3.1 --syntax-verify $(COMPILE)
#: 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
$(PYTHON) test_pythonlib.py --bytecode-3.2 --syntax-verify $(COMPILE)
#: 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
$(PYTHON) test_pythonlib.py --bytecode-3.3 --syntax-verify $(COMPILE)
#: 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
$(PYTHON) test_pythonlib.py --bytecode-3.4 --syntax-verify $(COMPILE)
#: 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
$(PYTHON) test_pythonlib.py --bytecode-3.5 --syntax-verify $(COMPILE)
#: Run working tests from Python 3.6
check-3.6: check-bytecode
$(PYTHON) test_pythonlib.py --bytecode-3.6 --weak-verify $(COMPILE)
$(PYTHON) test_pythonlib.py --bytecode-3.6-run --verify-run
$(PYTHON) test_pythonlib.py --bytecode-3.6 --syntax-verify $(COMPILE)
#: Run working tests from Python 3.7
check-3.7: check-bytecode
$(PYTHON) test_pythonlib.py --bytecode-3.7 --weak-verify $(COMPILE)
$(PYTHON) test_pythonlib.py --bytecode-3.7-run --verify-run
$(PYTHON) test_pythonlib.py --bytecode-3.7 --syntax-verify $(COMPILE)
# #: 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)
# FIXME
#: this is called when running under pypy3.5-5.8.0 or pypy2-5.6.0
@@ -80,7 +86,7 @@ check-disasm:
$(PYTHON) dis-compare.py
#: Check deparsing bytecode 1.x only
check-bytecode-1: check-bytecode-1.4 check-bytecode-1.5
check-bytecode-1: check-bytecode-1.0 check-bytecode-1.1 check-bytecode-1.2 check-bytecode-1.3 check-bytecode-1.4 check-bytecode-1.5 check-bytecode-1.6
#: Check deparsing bytecode 2.x only
check-bytecode-2:
@@ -92,8 +98,9 @@ check-bytecode-2:
check-bytecode-3:
$(PYTHON) test_pythonlib.py --bytecode-3.0 \
--bytecode-3.1 --bytecode-3.2 --bytecode-3.3 \
--bytecode-3.4 --bytecode-3.5 --bytecode-3.6 --bytecode-3.7 \
--bytecode-pypy3.2
--bytecode-3.4 --bytecode-3.5 --bytecode-3.6 \
--bytecode-3.7 \
--bytecode-pypy3.2 --bytecode-pypy3.6
#: Check deparsing on selected bytecode 3.x
check-bytecode-3-short:
@@ -103,6 +110,7 @@ check-bytecode-3-short:
#: Check deparsing bytecode on all Python 2 and Python 3 versions
check-bytecode: check-bytecode-3
$(PYTHON) test_pythonlib.py \
--bytecode-1.0 --bytecode-1.1 --bytecode-1.2 \
--bytecode-1.3 --bytecode-1.4 --bytecode-1.5 \
--bytecode-2.2 --bytecode-2.3 --bytecode-2.4 \
--bytecode-2.1 --bytecode-2.2 --bytecode-2.3 --bytecode-2.4 \
@@ -116,6 +124,18 @@ check-bytecode-short: check-bytecode-3-short
--bytecode-2.6 --bytecode-2.7 --bytecode-pypy2.7
#: Check deparsing bytecode 1.0 only
check-bytecode-1.0:
$(PYTHON) test_pythonlib.py --bytecode-1.0
#: Check deparsing bytecode 1.1 only
check-bytecode-1.1:
$(PYTHON) test_pythonlib.py --bytecode-1.1
#: Check deparsing bytecode 1.2 only
check-bytecode-1.2:
$(PYTHON) test_pythonlib.py --bytecode-1.2
#: Check deparsing bytecode 1.3 only
check-bytecode-1.3:
$(PYTHON) test_pythonlib.py --bytecode-1.3
@@ -128,6 +148,10 @@ check-bytecode-1.4:
check-bytecode-1.5:
$(PYTHON) test_pythonlib.py --bytecode-1.5
#: Check deparsing bytecode 1.6 only
check-bytecode-1.6:
$(PYTHON) test_pythonlib.py --bytecode-1.6
#: Check deparsing Python 2.1
check-bytecode-2.1:
$(PYTHON) test_pythonlib.py --bytecode-2.1
@@ -142,6 +166,7 @@ check-bytecode-2.3:
#: Check deparsing Python 2.4
check-bytecode-2.4:
$(PYTHON) test_pythonlib.py --bytecode-2.4-run --verify-run
$(PYTHON) test_pythonlib.py --bytecode-2.4
#: Check deparsing Python 2.5
@@ -170,7 +195,7 @@ grammar-coverage-2.6:
grammar-coverage-2.7:
-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
SPARK_PARSER_COVERAGE=$(COVER_DIR)/spark-grammar-2.7.cover $(PYTHON) test_pyenvlib.py --2.7.16 --max=600
#: Get grammar coverage for Python 3.0
grammar-coverage-3.0:
@@ -213,77 +238,92 @@ grammar-coverage-3.5:
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
SPARK_PARSER_COVERAGE=$(COVER_DIR)/spark-grammar-3.6.cover $(PYTHON) test_pyenvlib.py --3.6.8 --max=280
#: Get grammar coverage for Python 3.7
grammar-coverage-3.7:
rm $(COVER_DIR)/spark-grammar-3.7.cover || /bin/true
SPARK_PARSER_COVERAGE=$(COVER_DIR)/spark-grammar-3.7.cover $(PYTHON) test_pyenvlib.py --3.7.3 --max=500
#: Check deparsing Python 2.6
check-bytecode-2.6:
$(PYTHON) test_pythonlib.py --bytecode-2.6 --weak-verify
$(PYTHON) test_pythonlib.py --bytecode-2.6-run --verify-run
$(PYTHON) test_pythonlib.py --bytecode-2.6 --syntax-verify
#: Check deparsing Python 2.7
check-bytecode-2.7:
$(PYTHON) test_pythonlib.py --bytecode-2.7 --weak-verify
$(PYTHON) test_pythonlib.py --bytecode-2.7-run --verify-run
$(PYTHON) test_pythonlib.py --bytecode-2.7 --syntax-verify
#: Check deparsing Python 3.0
check-bytecode-3.0:
$(PYTHON) test_pythonlib.py --bytecode-3.0 --weak-verify
$(PYTHON) test_pythonlib.py --bytecode-3.0-run --verify-run
$(PYTHON) test_pythonlib.py --bytecode-3.0 --syntax-verify
#: 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
$(PYTHON) test_pythonlib.py --bytecode-3.1 --syntax-verify
#: 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
$(PYTHON) test_pythonlib.py --bytecode-3.2 --syntax-verify
#: Check deparsing Python 3.3
check-bytecode-3.3:
$(PYTHON) test_pythonlib.py --bytecode-3.3 --weak-verify
$(PYTHON) test_pythonlib.py --bytecode-3.3-run --verify-run
$(PYTHON) test_pythonlib.py --bytecode-3.3 --syntax-verify
#: Check deparsing Python 3.4
check-bytecode-3.4:
$(PYTHON) test_pythonlib.py --bytecode-3.4 --weak-verify
$(PYTHON) test_pythonlib.py --bytecode-3.4-run --verify-run
$(PYTHON) test_pythonlib.py --bytecode-3.4 --syntax-verify
#: Check deparsing Python 3.5
check-bytecode-3.5:
$(PYTHON) test_pythonlib.py --bytecode-3.5 --weak-verify
$(PYTHON) test_pythonlib.py --bytecode-3.5-run --verify-run
$(PYTHON) test_pythonlib.py --bytecode-3.5 --syntax-verify
#: Check deparsing Python 3.6
check-bytecode-3.6:
$(PYTHON) test_pythonlib.py --bytecode-3.6 --weak-verify
$(PYTHON) test_pythonlib.py --bytecode-3.6-run --verify-run
$(PYTHON) test_pythonlib.py --bytecode-3.6 --syntax-verify
#: Check deparsing Python 3.7
check-bytecode-3.7:
$(PYTHON) test_pythonlib.py --bytecode-3.7 --weak-verify
$(PYTHON) test_pythonlib.py --bytecode-3.7-run --verify-run
$(PYTHON) test_pythonlib.py --bytecode-3.7 --syntax-verify
# #: 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
#: short tests for bytecodes only for this version of Python
check-native-short:
$(PYTHON) test_pythonlib.py --bytecode-$(PYTHON_VERSION) --weak-verify $(COMPILE)
$(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 --weak-verify $(COMPILE)
$(PYTHON) test_pythonlib.py --ok-2.6 --syntax-verify $(COMPILE)
#: Run longer Python 2.7's lib files known to be okay
check-2.7-ok:
$(PYTHON) test_pythonlib.py --ok-2.7 --weak-verify $(COMPILE)
$(PYTHON) test_pythonlib.py --ok-2.7 --syntax-verify $(COMPILE)
#: Run longer Python 3.2's lib files known to be okay
check-3.2-ok:
$(PYTHON) test_pythonlib.py --ok-3.2 --weak-verify $(COMPILE)
$(PYTHON) test_pythonlib.py --ok-3.2 --syntax-verify $(COMPILE)
#: Run longer Python 3.4's lib files known to be okay
check-3.4-ok:
$(PYTHON) test_pythonlib.py --ok-3.4 --weak-verify $(COMPILE)
$(PYTHON) test_pythonlib.py --ok-3.4 --syntax-verify $(COMPILE)
#: PyPy of some sort. E.g. [PyPy 5.0.1 with GCC 4.8.4]
# Skip for now
@@ -297,6 +337,20 @@ pypy-2.7 5.0 5.3 6.0:
pypy-3.2 2.4:
$(PYTHON) test_pythonlib.py --bytecode-pypy3.2 --verify
#: PyPy 5.0.x with Python 3.6.1 ...
check-bytecode-pypy3.6: 7.1
7.1:
$(PYTHON) test_pythonlib.py --bytecode-pypy3.6-run --verify-run
$(PYTHON) test_pythonlib.py --bytecode-pypy3.6 --verify
#: PyPy 5.0.x with Python 3.6.9
check-bytecode-pypy3.6: 7.2
7.2:
$(PYTHON) test_pythonlib.py --bytecode-pypy3.6-run --verify-run
$(PYTHON) test_pythonlib.py --bytecode-pypy3.6 --verify
clean: clean-py-dis clean-dis clean-unverified
clean-dis:

View File

@@ -2,15 +2,23 @@
""" Trivial helper program to bytecompile and run an uncompile
"""
import os, sys, py_compile
assert len(sys.argv) >= 2
version = sys.version[0:3]
for path in sys.argv[1:]:
if sys.argv[1] in ("--run", "-r"):
suffix = "_run"
py_source = sys.argv[2:]
else:
suffix = ""
py_source = sys.argv[1:]
for path in py_source:
short = os.path.basename(path)
if hasattr(sys, 'pypy_version_info'):
cfile = "bytecode_pypy%s/%s" % (version, short) + 'c'
if hasattr(sys, "pypy_version_info"):
cfile = "bytecode_pypy%s%s/%s" % (version, suffix, short) + "c"
else:
cfile = "bytecode_%s/%s" % (version, short) + 'c'
cfile = "bytecode_%s%s/%s" % (version, suffix, short) + "c"
print("byte-compiling %s to %s" % (path, cfile))
py_compile.compile(path, cfile)
if isinstance(version, str) or version >= (2, 6, 0):
os.system("../bin/uncompyle6 -a -t %s" % cfile)
os.system("../bin/uncompyle6 -a -T %s" % cfile)

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.

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.

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.

Binary file not shown.

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