Compare commits

..

160 Commits

Author SHA1 Message Date
rocky
f98f7372c3 Administrivia 2019-12-24 12:52:32 -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
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
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
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
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
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
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
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
4773ca4e5b Go over runtests.sh tests 2019-12-14 18:15:34 -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
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
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
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
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
7d9c4ce8ca Better try/else detection 2019-12-09 14:04:57 -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
8c879c02de Small logic correction in run-time test. 2019-12-09 04:09:44 -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
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
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
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
09cc0d775a Pypy 3.3 tolerance and ...
Remove some duplicate grammar rules
2019-11-10 13:34:51 -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
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
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
d62dc3daac Get ready for release 3.4.1 2019-10-02 10:45:01 -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
251 changed files with 7839 additions and 2088 deletions

View File

@@ -1,11 +1,3 @@
# 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 version: 2
jobs: jobs:
build: build:
@@ -18,13 +10,6 @@ jobs:
CIRCLE_ARTIFACTS: /tmp/circleci-artifacts CIRCLE_ARTIFACTS: /tmp/circleci-artifacts
CIRCLE_TEST_REPORTS: /tmp/circleci-test-results CIRCLE_TEST_REPORTS: /tmp/circleci-test-results
COMPILE: --compile 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 # To see the list of pre-built images that CircleCI provides for most common languages see
# https://circleci.com/docs/2.0/circleci-images/ # https://circleci.com/docs/2.0/circleci-images/
machine: machine:
@@ -42,7 +27,7 @@ jobs:
# This is based on your 1.0 configuration file or project settings # This is based on your 1.0 configuration file or project settings
- run: - run:
working_directory: ~/rocky/python-uncompyle6 working_directory: ~/rocky/python-uncompyle6
command: pyenv install 2.4.6 && pyenv local 2.4.6 && pyenv rehash && easy_install nose && pyenv rehash command: pip install virtualenv && pip install nose && pip install pep8 && pyenv rehash
# Dependencies # Dependencies
# This would typically go in either a build or a build-and-test job when using workflows # This would typically go in either a build or a build-and-test job when using workflows
# Restore the dependency cache # Restore the dependency cache
@@ -53,6 +38,7 @@ jobs:
- v2-dependencies- - v2-dependencies-
# This is based on your 1.0 configuration file or project settings # This is based on your 1.0 configuration file or project settings
- run: pip install --upgrade setuptools
- run: pip install -e . - run: pip install -e .
- run: pip install -r requirements-dev.txt - run: pip install -r requirements-dev.txt
@@ -72,8 +58,8 @@ jobs:
# Test # Test
# This would typically be a build job when using workflows, possibly combined with build # 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 # This is based on your 1.0 configuration file or project settings
- run: python ./setup.py develop && make check-2.4 - run: python ./setup.py develop && make check-2.7
- run: cd ./test/stdlib && pyenv local 2.4.6 && bash ./runtests.sh 'test_[p-z]*.py' - run: cd ./test/stdlib && bash ./runtests.sh 'test_[p-z]*.py'
# Teardown # 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 # 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 # Save test results

View File

@@ -11,7 +11,7 @@ Please remove any of the optional sections if they are not applicable.
Prerequisites Prerequisites
* Make sure the bytecode you have can be disassembled with a * 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 * Don't put bytecode and corresponding source code on any service that
requires registration to download. requires registration to download.
* When you open a bug report there is no privacy. If the legitimacy of * 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 ## 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: output you got in describing how to reproduce the bug:
or give a complete console log with input and output or give a complete console log with input and output
@@ -63,7 +63,7 @@ can add that too.
Please modify for your setup Please modify for your setup
- Uncompyle6 version: output from `uncompyle6 --version` or `pip show uncompyle6` - 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] - OS and Version: [e.g. Ubuntu bionic]
--> -->

1
.gitignore vendored
View File

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

View File

@@ -1,11 +1,15 @@
language: python language: python
python: python:
- '2.7' # this is a cheat here because travis doesn't do 2.4-2.6 - '3.5'
- '2.7'
- '3.4'
- '3.6'
- '3.8'
matrix: matrix:
include: include:
- python: '2.7' - python: '3.7'
dist: xenial # required for Python >= 3.7 (travis-ci/travis-ci#9069) dist: xenial # required for Python >= 3.7 (travis-ci/travis-ci#9069)
install: install:

View File

@@ -40,16 +40,19 @@ check-3.0 check-3.1 check-3.2 check-3.6:
check-3.7: pytest check-3.7: pytest
$(MAKE) -C test check $(MAKE) -C test check
#:Tests for Python 2.4-2.5 (don't have pytest) check-3.8:
check-2.4 check-2.5: $(MAKE) -C test check
$(MAKE) -C test $@
#:PyPy 2.6.1 PyPy 5.0.1, or PyPy 5.8.0-beta0 #:PyPy 2.6.1 PyPy 5.0.1, or PyPy 5.8.0-beta0
# Skip for now # Skip for now
2.6 5.0 5.3 5.6 5.8: 2.6 5.0 5.3 5.6 5.8:
#:PyPy pypy3-2.4.0 Python 3: #:PyPy pypy3-2.4.0 Python 3.6.1:
pypy-3.2 2.4: 7.1 pypy-3.2 2.4:
$(MAKE) -C test $@
#:PyPy pypy3-2.4.0 Python 3.6.9:
7.2:
$(MAKE) -C test $@ $(MAKE) -C test $@
#: Run py.test tests #: Run py.test tests

88
NEWS.md
View File

@@ -1,3 +1,88 @@
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 3.4.0 2019-08-24 Totoro
======================= =======================
@@ -105,7 +190,8 @@ Lots of decomplation bugs, especially in the 3.x series fixed. Don't worry thoug
3.3.0 2019-04-14 Holy Week 3.3.0 2019-04-14 Holy Week
========================== ==========================
* First cut at Python 3.8 (many bug remain) * First cut at Python 3.8 (many bugs remain)
* Reinstate -c | --compile (compile before disassembly) option
* The usual smattering of bug and doc fixes * The usual smattering of bug and doc fixes
3.2.6 2019-03-23 Mueller Report 3.2.6 2019-03-23 Mueller Report

View File

@@ -1,4 +1,4 @@
|buildstatus| |Latest Version| |Supported Python Versions| |buildstatus| |Pypi Installs| |Latest Version| |Supported Python Versions|
|packagestatus| |packagestatus|
@@ -13,9 +13,9 @@ Introduction
------------ ------------
*uncompyle6* translates Python bytecode back into equivalent Python *uncompyle6* translates Python bytecode back into equivalent Python
source code. It accepts bytecodes from Python version 1.3 to version 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 3.8, spanning over 24 years of Python releases. We include Dropbox's
Python 2.5 bytecode and some PyPy bytecode. Python 2.5 bytecode and some PyPy bytecodes.
Why this? Why this?
--------- ---------
@@ -46,14 +46,15 @@ not exist and there is just bytecode. Again, my debuggers make use of
this. this.
There were (and still are) a number of decompyle, uncompyle, There were (and still are) a number of decompyle, uncompyle,
uncompyle2, uncompyle3 forks around. Almost all of them come basically uncompyle2, uncompyle3 forks around. Many of them come basically from
from the same code base, and (almost?) all of them are no longer the same code base, and (almost?) all of them are no longer actively
actively maintained. One was really good at decompiling Python 1.5-2.3 maintained. One was really good at decompiling Python 1.5-2.3, another
or so, another really good at Python 2.7, but that only. Another really good at Python 2.7, but that only. Another handles Python 3.2
handles Python 3.2 only; another patched that and handled only 3.3. only; another patched that and handled only 3.3. You get the
You get the idea. This code pulls all of these forks together and idea. This code pulls all of these forks together and *moves
*moves forward*. There is some serious refactoring and cleanup in this forward*. There is some serious refactoring and cleanup in this code
code base over those old forks. base over those old forks. Even more experimental refactoring is going
on in decompile3_.
This demonstrably does the best in decompiling Python across all This demonstrably does the best in decompiling Python across all
Python versions. And even when there is another project that only Python versions. And even when there is another project that only
@@ -75,11 +76,11 @@ fixed in the other decompilers.
Requirements Requirements
------------ ------------
The code here can be run on Python versions 2.6 or later, PyPy 3-2.4, 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 and later. Python versions 2.4-2.7 are supported in the python-2.4
python-2.4 branch. The bytecode files it can read have been tested on branch. The bytecode files it can read have been tested on Python
Python bytecodes from versions 1.4, 2.1-2.7, and 3.0-3.8 and the bytecodes from versions 1.4, 2.1-2.7, and 3.0-3.8 and later PyPy
above-mentioned PyPy versions. versions.
Installation Installation
------------ ------------
@@ -88,9 +89,9 @@ This uses setup.py, so it follows the standard Python routine:
:: ::
pip install -e . # set up to run from source tree $ pip install -e . # set up to run from source tree
# Or if you want to install instead # Or if you want to install instead
python setup.py install # may need sudo $ python setup.py install # may need sudo
A GNU makefile is also provided so :code:`make install` (possibly as root or A GNU makefile is also provided so :code:`make install` (possibly as root or
sudo) will do the steps above. sudo) will do the steps above.
@@ -186,15 +187,21 @@ they had been rare. Perhaps to compensate for the additional
added. So in sum handling control flow by ad hoc means as is currently added. So in sum handling control flow by ad hoc means as is currently
done is worse. done is worse.
Between Python 3.5, 3.6 and 3.7 there have been major changes to the Between Python 3.5, 3.6, 3.7 there have been major changes to the
:code:`MAKE_FUNCTION` and :code:`CALL_FUNCTION` instructions. :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 Currently not all Python magic numbers are supported. Specifically in
some versions of Python, notably Python 3.6, the magic number has some versions of Python, notably Python 3.6, the magic number has
changes several times within a version. changes several times within a version.
**We support only released versions, not candidate versions.** Note however **We support only released versions, not candidate versions.** Note
that the magic of a released version is usually the same as the *last* candidate version prior to release. 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, There are also customized Python interpreters, notably Dropbox,
which use their own magic and encrypt bytcode. With the exception of which use their own magic and encrypt bytcode. With the exception of
@@ -216,7 +223,7 @@ There is lots to do, so please dig in and help.
See Also 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://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/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 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 * 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
@@ -225,6 +232,7 @@ See Also
* https://github.com/rocky/python-xdis : Cross Python version disassembler * https://github.com/rocky/python-xdis : Cross Python version disassembler
* https://github.com/rocky/python-xasm : Cross Python version assembler * https://github.com/rocky/python-xasm : Cross Python version assembler
* https://github.com/rocky/python-uncompyle6/wiki : Wiki Documents which describe the code and aspects of it in more detail * 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 syas 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/trepan2g .. _trepan: https://pypi.python.org/pypi/trepan2g
@@ -233,6 +241,7 @@ See Also
.. _debuggers: https://pypi.python.org/pypi/trepan3k .. _debuggers: https://pypi.python.org/pypi/trepan3k
.. _remake: https://bashdb.sf.net/remake .. _remake: https://bashdb.sf.net/remake
.. _pycdc: https://github.com/zrax/pycdc .. _pycdc: https://github.com/zrax/pycdc
.. _decompile3: https://github.com/rocky/python-decompile3
.. _this: https://github.com/rocky/python-uncompyle6/wiki/Deparsing-technology-and-its-use-in-exact-location-reporting .. _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 .. |buildstatus| image:: https://travis-ci.org/rocky/python-uncompyle6.svg
:target: https://travis-ci.org/rocky/python-uncompyle6 :target: https://travis-ci.org/rocky/python-uncompyle6
@@ -244,3 +253,4 @@ See Also
.. |Supported Python Versions| image:: https://img.shields.io/pypi/pyversions/uncompyle6.svg .. |Supported Python Versions| image:: https://img.shields.io/pypi/pyversions/uncompyle6.svg
.. |Latest Version| image:: https://badge.fury.io/py/uncompyle6.svg .. |Latest Version| image:: https://badge.fury.io/py/uncompyle6.svg
:target: https://badge.fury.io/py/uncompyle6 :target: https://badge.fury.io/py/uncompyle6
.. |Pypi Installs| image:: https://pepy.tech/badge/uncompyle6/month

View File

@@ -58,7 +58,7 @@ entry_points = {
]} ]}
ftp_url = None ftp_url = None
install_requires = ["spark-parser >= 1.8.9, < 1.9.0", install_requires = ["spark-parser >= 1.8.9, < 1.9.0",
"xdis >= 4.0.3, < 4.1.0"] "xdis >= 4.2.2, < 4.3.0"]
license = "GPL3" license = "GPL3"
mailing_list = "python-debugger@googlegroups.com" mailing_list = "python-debugger@googlegroups.com"

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

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

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

View File

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

View File

@@ -1,46 +0,0 @@
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" echo "This script should be *sourced* rather than run directly through bash"
exit 1 exit 1
fi fi
export PYVERSIONS='3.6.8 3.7.3 2.6.9 3.3.7 2.7.16 3.2.6 3.1.5 3.4.8' export PYVERSIONS='3.5.9 3.6.9 2.6.9 3.3.7 2.7.17 3.2.6 3.1.5 3.4.8 3.7.6 3.8.1'

View File

@@ -6,4 +6,4 @@ if [[ $0 == ${BASH_SOURCE[0]} ]] ; then
echo "This script should be *sourced* rather than run directly through bash" echo "This script should be *sourced* rather than run directly through bash"
exit 1 exit 1
fi fi
export PYVERSIONS='2.4.6 2.5.6' export PYVERSIONS='2.4.6 2.5.6 2.6.9'

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

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

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

@@ -14,3 +14,4 @@ cd $fulldir/..
(cd ../python-xdis && git checkout python-2.4 && pyenv local $PYTHON_VERSION) && git pull && \ (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 git checkout python-2.4 && pyenv local $PYTHON_VERSION && git pull
cd $owd cd $owd
rm -v */.python-version || true

View File

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

View File

@@ -1,7 +1,11 @@
PHONY=check test pytest PHONY=check test pytest
SHELL=/bin/bash
PYTHON ?= python PYTHON ?= python
#: Run all tests #: Run all tests
test check pytest: 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)] [y for y in range(3)]
def get_parsed_for_fn(fn): def get_parsed_for_fn(fn):
code = fn.func_code code = fn.__code__ if PYTHON3 else fn.func_code
return deparse(code, version=PYTHON_VERSION) return deparse(code, version=PYTHON_VERSION)
def check_expect(expect, parsed, fn_name): def check_expect(expect, parsed, fn_name):

View File

@@ -20,7 +20,7 @@ def bug_loop(disassemble, tb=None):
disassemble(tb) disassemble(tb)
def test_if_in_for(): def test_if_in_for():
code = bug.func_code code = bug.__code__
scan = get_scanner(PYTHON_VERSION) scan = get_scanner(PYTHON_VERSION)
if 2.7 <= PYTHON_VERSION <= 3.0 and not IS_PYPY: if 2.7 <= PYTHON_VERSION <= 3.0 and not IS_PYPY:
scan.build_instructions(code) scan.build_instructions(code)

View File

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

View File

@@ -8,8 +8,12 @@ from uncompyle6.semantics.consts import (
if PYTHON3: if PYTHON3:
from io import StringIO from io import StringIO
def iteritems(d):
return d.items()
else: else:
from StringIO import StringIO from StringIO import StringIO
def iteritems(d):
return d.iteritems()
from uncompyle6.semantics.pysource import (SourceWalker, deparse_code2str) from uncompyle6.semantics.pysource import (SourceWalker, deparse_code2str)
@@ -26,7 +30,7 @@ def test_template_engine():
# FIXME: and so on... # FIXME: and so on...
from uncompyle6.semantics.consts import ( from uncompyle6.semantics.consts import (
TABLE_R, TABLE_DIRECT, TABLE_DIRECT, TABLE_R,
) )
from uncompyle6.semantics.fragments import ( from uncompyle6.semantics.fragments import (
@@ -40,7 +44,7 @@ def test_tables():
(TABLE_DIRECT, 'TABLE_DIRECT', False), (TABLE_DIRECT, 'TABLE_DIRECT', False),
(TABLE_R, 'TABLE_R', False), (TABLE_R, 'TABLE_R', False),
(TABLE_DIRECT_FRAGMENT, 'TABLE_DIRECT_FRAGMENT', True)): (TABLE_DIRECT_FRAGMENT, 'TABLE_DIRECT_FRAGMENT', True)):
for k, entry in t.iteritems(): for k, entry in iteritems(t):
if k in skip_for_now: if k in skip_for_now:
continue continue
fmt = entry[0] fmt = entry[0]

View File

@@ -1,4 +1,7 @@
import pytest
from uncompyle6 import PYTHON_VERSION, code_deparse 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: if PYTHON_VERSION > 2.6:
def test_single_mode(): def test_single_mode():

View File

@@ -9,4 +9,4 @@
12 JUMP_FORWARD 0 'to 15' 12 JUMP_FORWARD 0 'to 15'
15_0 COME_FROM 12 '12' 15_0 COME_FROM 12 '12'
15 LOAD_CONST None 15 LOAD_CONST None
18 RETURN_VALUE 18 RETURN_VALUE

View File

@@ -12,4 +12,4 @@
18 STORE_NAME 2 'd' 18 STORE_NAME 2 'd'
21_0 COME_FROM 12 '12' 21_0 COME_FROM 12 '12'
21 LOAD_CONST None 21 LOAD_CONST None
24 RETURN_VALUE 24 RETURN_VALUE

View File

@@ -1,4 +1,3 @@
flake8 flake8
hypothesis<=3.0.0
six six
pytest==3.2.5 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] [bdist_rpm]
release = 1 release = 1
packager = Mysterie <kajusska@gmail.com> packager = rocky <rb@dustyfeet.com>
doc_files = README doc_files = README
# CHANGES.txt
# USAGE.txt
# doc/
# examples/
[bdist_wheel] [bdist_wheel]
universal=1
[egg_info]
tag_build =
tag_date = 0

View File

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

View File

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

View File

@@ -1,5 +1,6 @@
PHONY=check clean dist distclean test test-unit test-functional rmChangeLog clean_pyc nosetests \ PHONY=check clean dist distclean test test-unit test-functional rmChangeLog clean_pyc nosetests \
check-bytecode-1 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 check-bytecode-3 check-bytecode-3-short \
check-bytecode-2.2 check-byteocde-2.3 check-bytecode-2.4 \ check-bytecode-2.2 check-byteocde-2.3 check-bytecode-2.4 \
check-short check-2.6 check-2.7 check-3.0 check-3.1 check-3.2 check-3.3 \ check-short check-2.6 check-2.7 check-3.0 check-3.1 check-3.2 check-3.3 \
@@ -22,14 +23,14 @@ COVER_DIR=../tmp/grammar-cover
# Run short tests # Run short tests
check-short: check-short:
@$(PYTHON) -V && PYTHON_VERSION=`$(PYTHON) -V 2>&1 | cut -d ' ' -f 2 | cut -d'.' -f1,2`; \ @$(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 # Run all tests
check: check:
$(MAKE) check-$(PYTHON_VERSION) $(MAKE) check-$(PYTHON_VERSION)
#: Run working tests from Python 2.6 or 2.7 #: Run working tests from Python 2.6 or 2.7
check-2.4 check-2.5 check-2.6 check-2.7: check-bytecode-2 check-bytecode-3 check-bytecode-1 check-native-short 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 #: Run working tests from Python 3.0
check-3.0: check-bytecode check-3.0: check-bytecode
@@ -71,10 +72,10 @@ check-3.7: check-bytecode
$(PYTHON) test_pythonlib.py --bytecode-3.7-run --verify-run $(PYTHON) test_pythonlib.py --bytecode-3.7-run --verify-run
$(PYTHON) test_pythonlib.py --bytecode-3.7 --syntax-verify $(COMPILE) $(PYTHON) test_pythonlib.py --bytecode-3.7 --syntax-verify $(COMPILE)
# #: Run working tests from Python 3.8 #: Run working tests from Python 3.8
# check-3.8: check-bytecode check-3.8: check-bytecode
# $(PYTHON) test_pythonlib.py --bytecode-3.8-run --verify-run $(PYTHON) test_pythonlib.py --bytecode-3.8-run --verify-run
# $(PYTHON) test_pythonlib.py --bytecode-3.8 --syntax-verify $(COMPILE) $(PYTHON) test_pythonlib.py --bytecode-3.8 --syntax-verify $(COMPILE)
# FIXME # FIXME
#: this is called when running under pypy3.5-5.8.0 or pypy2-5.6.0 #: this is called when running under pypy3.5-5.8.0 or pypy2-5.6.0
@@ -85,7 +86,7 @@ check-disasm:
$(PYTHON) dis-compare.py $(PYTHON) dis-compare.py
#: Check deparsing bytecode 1.x only #: Check deparsing bytecode 1.x only
check-bytecode-1: check-bytecode-1.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 deparsing bytecode 2.x only
check-bytecode-2: check-bytecode-2:
@@ -98,8 +99,8 @@ check-bytecode-3:
$(PYTHON) test_pythonlib.py --bytecode-3.0 \ $(PYTHON) test_pythonlib.py --bytecode-3.0 \
--bytecode-3.1 --bytecode-3.2 --bytecode-3.3 \ --bytecode-3.1 --bytecode-3.2 --bytecode-3.3 \
--bytecode-3.4 --bytecode-3.5 --bytecode-3.6 \ --bytecode-3.4 --bytecode-3.5 --bytecode-3.6 \
--bytecode-3.7 \ --bytecode-3.7 \
--bytecode-pypy3.2 --bytecode-pypy3.2 --bytecode-pypy3.6 --bytecode-3.8
#: Check deparsing on selected bytecode 3.x #: Check deparsing on selected bytecode 3.x
check-bytecode-3-short: check-bytecode-3-short:
@@ -109,6 +110,7 @@ check-bytecode-3-short:
#: Check deparsing bytecode on all Python 2 and Python 3 versions #: Check deparsing bytecode on all Python 2 and Python 3 versions
check-bytecode: check-bytecode-3 check-bytecode: check-bytecode-3
$(PYTHON) test_pythonlib.py \ $(PYTHON) test_pythonlib.py \
--bytecode-1.0 --bytecode-1.1 --bytecode-1.2 \
--bytecode-1.3 --bytecode-1.4 --bytecode-1.5 \ --bytecode-1.3 --bytecode-1.4 --bytecode-1.5 \
--bytecode-2.2 --bytecode-2.3 --bytecode-2.4 \ --bytecode-2.2 --bytecode-2.3 --bytecode-2.4 \
--bytecode-2.1 --bytecode-2.2 --bytecode-2.3 --bytecode-2.4 \ --bytecode-2.1 --bytecode-2.2 --bytecode-2.3 --bytecode-2.4 \
@@ -122,6 +124,18 @@ check-bytecode-short: check-bytecode-3-short
--bytecode-2.6 --bytecode-2.7 --bytecode-pypy2.7 --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 deparsing bytecode 1.3 only
check-bytecode-1.3: check-bytecode-1.3:
$(PYTHON) test_pythonlib.py --bytecode-1.3 $(PYTHON) test_pythonlib.py --bytecode-1.3
@@ -134,6 +148,10 @@ check-bytecode-1.4:
check-bytecode-1.5: check-bytecode-1.5:
$(PYTHON) test_pythonlib.py --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 deparsing Python 2.1
check-bytecode-2.1: check-bytecode-2.1:
$(PYTHON) test_pythonlib.py --bytecode-2.1 $(PYTHON) test_pythonlib.py --bytecode-2.1
@@ -148,7 +166,6 @@ check-bytecode-2.3:
#: Check deparsing Python 2.4 #: Check deparsing Python 2.4
check-bytecode-2.4: check-bytecode-2.4:
$(PYTHON) test_pythonlib.py --bytecode-2.4-run --verify-run
$(PYTHON) test_pythonlib.py --bytecode-2.4 $(PYTHON) test_pythonlib.py --bytecode-2.4
#: Check deparsing Python 2.5 #: Check deparsing Python 2.5
@@ -277,20 +294,16 @@ check-bytecode-3.7:
$(PYTHON) test_pythonlib.py --bytecode-3.7-run --verify-run $(PYTHON) test_pythonlib.py --bytecode-3.7-run --verify-run
$(PYTHON) test_pythonlib.py --bytecode-3.7 --syntax-verify $(PYTHON) test_pythonlib.py --bytecode-3.7 --syntax-verify
# #: Check deparsing Python 3.8 #: Check deparsing Python 3.8
# check-bytecode-3.8: check-bytecode-3.8:
# $(PYTHON) test_pythonlib.py --bytecode-3.8-run --verify-run $(PYTHON) test_pythonlib.py --bytecode-3.8-run --verify-run
# $(PYTHON) test_pythonlib.py --bytecode-3.8 --syntax-verify $(PYTHON) test_pythonlib.py --bytecode-3.8 --syntax-verify
#: short tests for bytecodes only for this version of Python #: short tests for bytecodes only for this version of Python
check-native-short: check-native-short:
$(PYTHON) test_pythonlib.py --bytecode-$(PYTHON_VERSION) --syntax-verify $(COMPILE) $(PYTHON) test_pythonlib.py --bytecode-$(PYTHON_VERSION) --syntax-verify $(COMPILE)
$(PYTHON) test_pythonlib.py --bytecode-$(PYTHON_VERSION)-run --verify-run $(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 #: Run longer Python 2.6's lib files known to be okay
check-2.6-ok: check-2.6-ok:
$(PYTHON) test_pythonlib.py --ok-2.6 --syntax-verify $(COMPILE) $(PYTHON) test_pythonlib.py --ok-2.6 --syntax-verify $(COMPILE)
@@ -319,8 +332,16 @@ pypy-2.7 5.0 5.3 6.0:
pypy-3.2 2.4: pypy-3.2 2.4:
$(PYTHON) test_pythonlib.py --bytecode-pypy3.2 --verify $(PYTHON) test_pythonlib.py --bytecode-pypy3.2 --verify
#: PyPy 5.0.x with Python 3.6 ... #: PyPy 5.0.x with Python 3.6.1 ...
check-bytecode-pypy3.6: 7.1
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 $(PYTHON) test_pythonlib.py --bytecode-pypy3.6 --verify

View File

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

Binary file not shown.

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