You've already forked python-uncompyle6
mirror of
https://github.com/rocky/python-uncompyle6.git
synced 2025-08-04 01:09:52 +08:00
Compare commits
384 Commits
release-2.
...
release-3.
Author | SHA1 | Date | |
---|---|---|---|
|
350a16cfa2 | ||
|
5a7024d2a3 | ||
|
e16138527a | ||
|
2362045c84 | ||
|
a29afd6832 | ||
|
1bcf0d54f7 | ||
|
4c6bdd58ab | ||
|
7898fa157b | ||
|
bbdb238ddb | ||
|
ec42ee540c | ||
|
616e5c82f6 | ||
|
1cb31a85fd | ||
|
7d1ecf957c | ||
|
c96e796ff5 | ||
|
f14e1dd62f | ||
|
5f1667988f | ||
|
19ec52eb63 | ||
|
c3e722ad51 | ||
|
31de342528 | ||
|
70f25d5f8d | ||
|
1b71cfef07 | ||
|
e7845ed2e4 | ||
|
f4a1e9e40f | ||
|
b9e8e619f6 | ||
|
5c88f804c1 | ||
|
35834b06d4 | ||
|
27febca918 | ||
|
37b917ed7c | ||
|
82499b50bb | ||
|
c6b3e20b47 | ||
|
93e889e82a | ||
|
4cbd136635 | ||
|
488a14488c | ||
|
44321fcedf | ||
|
1e0a6d528e | ||
|
40fa379fd9 | ||
|
34ec41f274 | ||
|
3daf3732c3 | ||
|
988efa3693 | ||
|
bc16cc93d6 | ||
|
8d1bd6d5b5 | ||
|
c148e49670 | ||
|
fb31fe1f35 | ||
|
fa5da2b1ef | ||
|
f331deb864 | ||
|
1350f4c899 | ||
|
6fd8d2556b | ||
|
276fb77e71 | ||
|
f547ec9291 | ||
|
4f994b4cae | ||
|
98cd06d6e0 | ||
|
a3b6806c33 | ||
|
66ebb15d42 | ||
|
8955788990 | ||
|
9415ad34ff | ||
|
476db9ad1d | ||
|
9ba0b1bad2 | ||
|
b7942bc5f2 | ||
|
3ac4f1ee61 | ||
|
55d2df04f7 | ||
|
6d529d3cee | ||
|
201e5b18b1 | ||
|
ac2bbfc65a | ||
|
3b8e6635e2 | ||
|
7e172b63d1 | ||
|
c01eb554ed | ||
|
d32e67891b | ||
|
78b8d1cd06 | ||
|
600e56b1d7 | ||
|
170504c518 | ||
|
e3d918df3d | ||
|
e7b62a722f | ||
|
92d63ac598 | ||
|
79bed3419f | ||
|
0353b74a7a | ||
|
67910e7d8e | ||
|
61fa4fe391 | ||
|
a8cdcc4d85 | ||
|
f0176add7a | ||
|
45c8d62e68 | ||
|
096563cf91 | ||
|
7fd21aa227 | ||
|
82bc294995 | ||
|
9d3e4a6660 | ||
|
7dfade1195 | ||
|
1df5aa0ef9 | ||
|
c06ba45991 | ||
|
7fab91eb4e | ||
|
c2181e3235 | ||
|
3695921364 | ||
|
d14193f219 | ||
|
94251cd294 | ||
|
a9515c7aab | ||
|
e5f3d803a8 | ||
|
e5ae70bea8 | ||
|
189605ea2c | ||
|
4c74bf1d9d | ||
|
c087bd785e | ||
|
80b68af2d3 | ||
|
24ccc16701 | ||
|
69714fb65a | ||
|
b94f98f8f7 | ||
|
f05b092983 | ||
|
76a66c3460 | ||
|
91224b2382 | ||
|
e76f1f107f | ||
|
2f8e063a99 | ||
|
15533c5e38 | ||
|
6511cc4dd4 | ||
|
fdf97a1cc0 | ||
|
24011bb0da | ||
|
4f61321c91 | ||
|
269f4f2e1b | ||
|
aab951280b | ||
|
f1e48fb60a | ||
|
c0022ed5b7 | ||
|
41a50b5e46 | ||
|
0154c87d63 | ||
|
c9c70103aa | ||
|
a18dc340ce | ||
|
037648577f | ||
|
cd62e54c88 | ||
|
ef9ccc3a8c | ||
|
c397bf6bda | ||
|
0aa41058a6 | ||
|
27f67e6fca | ||
|
6fcf49b214 | ||
|
49661b222e | ||
|
c481d97866 | ||
|
ab5303f504 | ||
|
6c6d62edb8 | ||
|
245deb0931 | ||
|
87b70cfd13 | ||
|
bbc7616e24 | ||
|
d5b7be59c5 | ||
|
7a4c11c3f4 | ||
|
9ef38285f4 | ||
|
5de8a33286 | ||
|
9e652f3fc6 | ||
|
9fa7b9ea53 | ||
|
1890aad660 | ||
|
7237658f1f | ||
|
fa6408d53b | ||
|
da57e2d416 | ||
|
9545541be7 | ||
|
98f969592c | ||
|
edbab038ca | ||
|
08cbf56eea | ||
|
8734608929 | ||
|
ab414d3d9c | ||
|
ede6eabc40 | ||
|
61e2b3b635 | ||
|
23fb07b1c9 | ||
|
1bbb72a6ce | ||
|
17361a9baa | ||
|
68821efdb0 | ||
|
e9ee671874 | ||
|
9593043432 | ||
|
1c95eb7b4e | ||
|
ff9ae4e792 | ||
|
d9eb5c5b09 | ||
|
e7b7de8842 | ||
|
3f26589bf1 | ||
|
30ce3a8bea | ||
|
341e17f62c | ||
|
b561b0090c | ||
|
ca41ea99f2 | ||
|
e3040c78a9 | ||
|
a556e96c22 | ||
|
e9c0d03b8b | ||
|
155fd06372 | ||
|
acff1b6ee0 | ||
|
1cd2d1e915 | ||
|
e2dec73a62 | ||
|
fad43feb3d | ||
|
96d8daeae9 | ||
|
8f6a1cb10b | ||
|
fc98bc972e | ||
|
007ba4a8f3 | ||
|
6b78677a74 | ||
|
ab1dba1536 | ||
|
254d0519bb | ||
|
120412f5a8 | ||
|
b54be24e14 | ||
|
535df1592e | ||
|
64ffa5f6ab | ||
|
9be4908c9c | ||
|
f18ce71e91 | ||
|
362a353e03 | ||
|
7d110f17bc | ||
|
04f4f3c25f | ||
|
1d5f4b0a05 | ||
|
dc3e6b31ca | ||
|
94a81a36b7 | ||
|
e568d68baa | ||
|
8c22d57979 | ||
|
bf0f5715a3 | ||
|
d90c44b454 | ||
|
9d807501af | ||
|
aa4416571b | ||
|
d38395334c | ||
|
516c7a0e9a | ||
|
681588f12d | ||
|
3500c49daf | ||
|
3d218c84b0 | ||
|
1afe1fd943 | ||
|
c5f8bbf32d | ||
|
6b36d14859 | ||
|
ccbe8a8e2b | ||
|
46c02bd352 | ||
|
30ba043000 | ||
|
1f0e5f27d5 | ||
|
75245ba38c | ||
|
4889916304 | ||
|
d1806edaad | ||
|
c968e31be8 | ||
|
c8870c6ed8 | ||
|
23180806b4 | ||
|
1f835d6237 | ||
|
3d072e29a6 | ||
|
74f01fbe33 | ||
|
710c950965 | ||
|
7aa6ff1d9b | ||
|
421c358f9d | ||
|
cfb4ad625f | ||
|
0b622a0ad8 | ||
|
8b7d5d3270 | ||
|
5c7fdf6e8f | ||
|
d2c8e4e12c | ||
|
626f690a5a | ||
|
39cef6a41b | ||
|
116fbb33e0 | ||
|
631940887f | ||
|
47beff57b2 | ||
|
7fb94176b1 | ||
|
2ae9cd7d08 | ||
|
1f663013ab | ||
|
e3c7afb94d | ||
|
0d327ab0ce | ||
|
35a60e0274 | ||
|
1b2b45642b | ||
|
28bfb453f5 | ||
|
df55ce3212 | ||
|
fcb4409e50 | ||
|
155031a7c4 | ||
|
c81b40b43b | ||
|
7fc7e083c3 | ||
|
d41a858f80 | ||
|
6dd0ad0810 | ||
|
9368b63a2f | ||
|
da06d83a87 | ||
|
6fb5808ff0 | ||
|
0c3db340fa | ||
|
925b6667d7 | ||
|
b8547346b7 | ||
|
0aa7a7c223 | ||
|
cf5445c202 | ||
|
bc8c38ee58 | ||
|
4cd81dab61 | ||
|
4f4b628842 | ||
|
ff50a7f37b | ||
|
85a49aec2f | ||
|
9f2c7352e7 | ||
|
e9cf370e11 | ||
|
90ac8a463d | ||
|
0e64111195 | ||
|
fd84325e4f | ||
|
ddc00edd42 | ||
|
4259963859 | ||
|
4905cc6bb0 | ||
|
f008b8f411 | ||
|
2e81ee5d2e | ||
|
50e59a37c1 | ||
|
5c8f93b735 | ||
|
88ef4baca8 | ||
|
6ab711baab | ||
|
9e05750537 | ||
|
5c662b334e | ||
|
56b2e17e30 | ||
|
94038151f4 | ||
|
b9281c79be | ||
|
51dec051df | ||
|
f5ac06013f | ||
|
06bbacef45 | ||
|
bfdc6529a0 | ||
|
1ed389ce61 | ||
|
19f2e1277b | ||
|
6290311143 | ||
|
947d619c77 | ||
|
908d313204 | ||
|
38dffa3290 | ||
|
c8747cc899 | ||
|
8a705a70f5 | ||
|
92d562e600 | ||
|
30756c52b2 | ||
|
74e280171b | ||
|
df0207eb90 | ||
|
07a8ae9541 | ||
|
5d6872bcd1 | ||
|
c03cdf1a49 | ||
|
01ad91b519 | ||
|
ccd42077c1 | ||
|
ca3f822c81 | ||
|
1896c40202 | ||
|
8278c72a6f | ||
|
3b0a5aab16 | ||
|
a74890d388 | ||
|
5d24367ef6 | ||
|
cad1325a90 | ||
|
61534ceed5 | ||
|
9f66694056 | ||
|
2bdfd76635 | ||
|
01f2f6578b | ||
|
02b1554da3 | ||
|
fac5d31f34 | ||
|
d42858cae4 | ||
|
9e815d8d79 | ||
|
def9e1676b | ||
|
35fcb1edf1 | ||
|
ffbce9cb77 | ||
|
dc1971f559 | ||
|
cef61904c7 | ||
|
778f92b6f4 | ||
|
a8260edded | ||
|
c662cb1df2 | ||
|
e809ade6e1 | ||
|
d080b4402d | ||
|
7200d298a5 | ||
|
bb13988126 | ||
|
8d503682b3 | ||
|
26e1df835c | ||
|
6807015526 | ||
|
99d9beac76 | ||
|
452d17a6c3 | ||
|
8d1c454376 | ||
|
2edc757b6f | ||
|
ef076c065b | ||
|
a0e3759f76 | ||
|
f7439f506a | ||
|
257c3ca454 | ||
|
e23315b2e6 | ||
|
413df51dfa | ||
|
1fe432585e | ||
|
b128e4fde6 | ||
|
7eb19a8617 | ||
|
b6d96929cb | ||
|
68692abaf6 | ||
|
55a10d9e20 | ||
|
e9d1b86a5b | ||
|
afb90dd12e | ||
|
c43c9a19aa | ||
|
d3f5ec6f30 | ||
|
5c2d0484e5 | ||
|
31de0d2af5 | ||
|
195075ac01 | ||
|
d09e820d89 | ||
|
b584a0f6b0 | ||
|
df7cfa2d20 | ||
|
7f3956c996 | ||
|
98394d18bb | ||
|
493835b8cd | ||
|
f6aa775d58 | ||
|
2f6a85d538 | ||
|
8c0f256b78 | ||
|
6e2ca8f53d | ||
|
c1ed6dea62 | ||
|
ab1c2ec5bb | ||
|
e3d0b1b9ce | ||
|
aaf83ea35d | ||
|
cb24973147 | ||
|
3545c7dc6f | ||
|
8463221527 | ||
|
6b6a085b08 | ||
|
30fbdff29c | ||
|
26e65e0d90 | ||
|
a2b6ebc669 | ||
|
09efb24a3e | ||
|
a1b2a91d88 | ||
|
859ce2206d | ||
|
ee89b5decd | ||
|
8864034966 | ||
|
deb9903a97 | ||
|
f4b7e54313 | ||
|
08c7966ef9 |
89
.circleci/config.yml
Normal file
89
.circleci/config.yml
Normal file
@@ -0,0 +1,89 @@
|
|||||||
|
# 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.
|
||||||
|
# If any of these refer to each other, rewrite them so that they don't or see https://circleci.com/docs/2.0/env-vars/#interpolating-environment-variables-to-set-other-environment-variables .
|
||||||
|
environment:
|
||||||
|
CIRCLE_ARTIFACTS: /tmp/circleci-artifacts
|
||||||
|
CIRCLE_TEST_REPORTS: /tmp/circleci-test-results
|
||||||
|
COMPILE: --compile
|
||||||
|
# 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
|
||||||
|
steps:
|
||||||
|
# Machine Setup
|
||||||
|
# If you break your build into multiple jobs with workflows, you will probably want to do the parts of this that are relevant in each
|
||||||
|
# The following `checkout` command checks out your code to your working directory. In 1.0 we did this implicitly. In 2.0 you can choose where in the course of a job your code should be checked out.
|
||||||
|
- checkout
|
||||||
|
# Prepare for artifact and test results collection equivalent to how it was done on 1.0.
|
||||||
|
# In many cases you can simplify this from what is generated here.
|
||||||
|
# 'See docs on artifact collection here https://circleci.com/docs/2.0/artifacts/'
|
||||||
|
- run: mkdir -p $CIRCLE_ARTIFACTS $CIRCLE_TEST_REPORTS
|
||||||
|
# This is based on your 1.0 configuration file or project settings
|
||||||
|
- run:
|
||||||
|
working_directory: ~/rocky/python-uncompyle6
|
||||||
|
command: pyenv install 2.7.13 && pyenv local 2.7.13 && 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-
|
||||||
|
# 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
|
||||||
|
# Save dependency cache
|
||||||
|
- save_cache:
|
||||||
|
key: v1-dep-{{ .Branch }}-{{ epoch }}
|
||||||
|
paths:
|
||||||
|
# This is a broad list of cache paths to include many possible development environments
|
||||||
|
# You can probably delete some of these entries
|
||||||
|
- vendor/bundle
|
||||||
|
- ~/virtualenvs
|
||||||
|
- ~/.m2
|
||||||
|
- ~/.ivy2
|
||||||
|
- ~/.bundle
|
||||||
|
- ~/.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.13 && bash ./runtests.sh 'test_[p-z]*.py'
|
||||||
|
# Teardown
|
||||||
|
# If you break your build into multiple jobs with workflows, you will probably want to do the parts of this that are relevant in each
|
||||||
|
# Save test results
|
||||||
|
- store_test_results:
|
||||||
|
path: /tmp/circleci-test-results
|
||||||
|
# Save artifacts
|
||||||
|
- store_artifacts:
|
||||||
|
path: /tmp/circleci-artifacts
|
||||||
|
- store_artifacts:
|
||||||
|
path: /tmp/circleci-test-results
|
77
.github/ISSUE_TEMPLATE/bug-report.md
vendored
Normal file
77
.github/ISSUE_TEMPLATE/bug-report.md
vendored
Normal file
@@ -0,0 +1,77 @@
|
|||||||
|
---
|
||||||
|
name: Bug report
|
||||||
|
about: Tell us about uncompyle6 bugs
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
<!-- __Note:__ Have you read https://github.com/rocky/python-uncompyle6/blob/master/HOW-TO-REPORT-A-BUG.md ?
|
||||||
|
|
||||||
|
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.
|
||||||
|
* 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
|
||||||
|
the activity is deemed suspicous, I may flag it as suspicious,
|
||||||
|
making the issue even more easy to detect.
|
||||||
|
|
||||||
|
Bug reports that violate a prerequisite may be discarded.
|
||||||
|
|
||||||
|
Note that there are way more bug-fix requestors than there are bug
|
||||||
|
fixers. If you want you need more immediate, confidential or urgent
|
||||||
|
assistance
|
||||||
|
|
||||||
|
http://www.crazy-compilers.com/decompyle/ offers a byte-code
|
||||||
|
decompiler service for versions of Python up to 2.6.
|
||||||
|
|
||||||
|
-->
|
||||||
|
|
||||||
|
## Description
|
||||||
|
|
||||||
|
<!-- Add a clear and concise description of the bug. -->
|
||||||
|
|
||||||
|
## How to Reproduce
|
||||||
|
|
||||||
|
<!-- 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
|
||||||
|
|
||||||
|
```console
|
||||||
|
$ uncompyle6 <command-line-options>
|
||||||
|
...
|
||||||
|
$
|
||||||
|
```
|
||||||
|
|
||||||
|
Provide links to the Python bytecode. For example you can create a
|
||||||
|
gist with the information. If you have the correct source code, you
|
||||||
|
can add that too.
|
||||||
|
|
||||||
|
-->
|
||||||
|
|
||||||
|
## Expected behavior
|
||||||
|
|
||||||
|
<!-- Add a clear and concise description of what you expected to happen. -->
|
||||||
|
|
||||||
|
## Environment
|
||||||
|
|
||||||
|
<!-- _This section sometimes is optional but helpful to us._
|
||||||
|
|
||||||
|
Please modify for your setup
|
||||||
|
|
||||||
|
- Uncompyle6 version: output from `uncompyle6 --version` or `pip show uncompyle6`
|
||||||
|
- Python version: `python -V`
|
||||||
|
- OS and Version: [e.g. Ubuntu bionic]
|
||||||
|
|
||||||
|
-->
|
||||||
|
|
||||||
|
## Additional Environment or Context
|
||||||
|
|
||||||
|
<!-- _This section is optional._
|
||||||
|
|
||||||
|
Add any other context about the problem here or special environment setup.
|
||||||
|
|
||||||
|
-->
|
22
.github/ISSUE_TEMPLATE/feature-request.md
vendored
Normal file
22
.github/ISSUE_TEMPLATE/feature-request.md
vendored
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
---
|
||||||
|
name: Feature Request
|
||||||
|
about: Tell us about a new feature that you would like to see in uncompyle6
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## Description
|
||||||
|
|
||||||
|
<!-- Add a short description of the feature. This might
|
||||||
|
include same input and output. -->
|
||||||
|
|
||||||
|
## Background
|
||||||
|
|
||||||
|
<!-- Add any additional background for the
|
||||||
|
feature, for example: user scenarios, or the value of the feature. -->
|
||||||
|
|
||||||
|
## Tests
|
||||||
|
<!-- _This section is optional._
|
||||||
|
|
||||||
|
Add text with suggestions on how to test the feature,
|
||||||
|
if it is not obvious.
|
||||||
|
-->
|
12
.gitignore
vendored
12
.gitignore
vendored
@@ -1,11 +1,15 @@
|
|||||||
*.pyo
|
|
||||||
*.pyc
|
*.pyc
|
||||||
|
*.pyo
|
||||||
*_dis
|
*_dis
|
||||||
*~
|
*~
|
||||||
/.cache
|
/.cache
|
||||||
/.eggs
|
/.eggs
|
||||||
|
/.hypothesis
|
||||||
|
/.idea
|
||||||
|
/.pytest_cache
|
||||||
/.python-version
|
/.python-version
|
||||||
/.tox
|
/.tox
|
||||||
|
/.venv*
|
||||||
/README
|
/README
|
||||||
/__pkginfo__.pyc
|
/__pkginfo__.pyc
|
||||||
/dist
|
/dist
|
||||||
@@ -14,9 +18,7 @@
|
|||||||
/tmp
|
/tmp
|
||||||
/uncompyle6.egg-info
|
/uncompyle6.egg-info
|
||||||
/unpyc
|
/unpyc
|
||||||
|
ChangeLog
|
||||||
__pycache__
|
__pycache__
|
||||||
build
|
build
|
||||||
/.venv*
|
nohup.out
|
||||||
/.idea
|
|
||||||
/.hypothesis
|
|
||||||
ChangeLog
|
|
||||||
|
@@ -4,11 +4,9 @@ sudo: false
|
|||||||
|
|
||||||
python:
|
python:
|
||||||
- '3.5'
|
- '3.5'
|
||||||
- '2.7.12'
|
- '2.7'
|
||||||
- '2.6'
|
- '2.6'
|
||||||
- '3.3'
|
|
||||||
- '3.4'
|
- '3.4'
|
||||||
- '3.2'
|
|
||||||
- '3.6'
|
- '3.6'
|
||||||
|
|
||||||
install:
|
install:
|
||||||
|
674
COPYING
Normal file
674
COPYING
Normal file
@@ -0,0 +1,674 @@
|
|||||||
|
GNU GENERAL PUBLIC LICENSE
|
||||||
|
Version 3, 29 June 2007
|
||||||
|
|
||||||
|
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
|
||||||
|
Everyone is permitted to copy and distribute verbatim copies
|
||||||
|
of this license document, but changing it is not allowed.
|
||||||
|
|
||||||
|
Preamble
|
||||||
|
|
||||||
|
The GNU General Public License is a free, copyleft license for
|
||||||
|
software and other kinds of works.
|
||||||
|
|
||||||
|
The licenses for most software and other practical works are designed
|
||||||
|
to take away your freedom to share and change the works. By contrast,
|
||||||
|
the GNU General Public License is intended to guarantee your freedom to
|
||||||
|
share and change all versions of a program--to make sure it remains free
|
||||||
|
software for all its users. We, the Free Software Foundation, use the
|
||||||
|
GNU General Public License for most of our software; it applies also to
|
||||||
|
any other work released this way by its authors. You can apply it to
|
||||||
|
your programs, too.
|
||||||
|
|
||||||
|
When we speak of free software, we are referring to freedom, not
|
||||||
|
price. Our General Public Licenses are designed to make sure that you
|
||||||
|
have the freedom to distribute copies of free software (and charge for
|
||||||
|
them if you wish), that you receive source code or can get it if you
|
||||||
|
want it, that you can change the software or use pieces of it in new
|
||||||
|
free programs, and that you know you can do these things.
|
||||||
|
|
||||||
|
To protect your rights, we need to prevent others from denying you
|
||||||
|
these rights or asking you to surrender the rights. Therefore, you have
|
||||||
|
certain responsibilities if you distribute copies of the software, or if
|
||||||
|
you modify it: responsibilities to respect the freedom of others.
|
||||||
|
|
||||||
|
For example, if you distribute copies of such a program, whether
|
||||||
|
gratis or for a fee, you must pass on to the recipients the same
|
||||||
|
freedoms that you received. You must make sure that they, too, receive
|
||||||
|
or can get the source code. And you must show them these terms so they
|
||||||
|
know their rights.
|
||||||
|
|
||||||
|
Developers that use the GNU GPL protect your rights with two steps:
|
||||||
|
(1) assert copyright on the software, and (2) offer you this License
|
||||||
|
giving you legal permission to copy, distribute and/or modify it.
|
||||||
|
|
||||||
|
For the developers' and authors' protection, the GPL clearly explains
|
||||||
|
that there is no warranty for this free software. For both users' and
|
||||||
|
authors' sake, the GPL requires that modified versions be marked as
|
||||||
|
changed, so that their problems will not be attributed erroneously to
|
||||||
|
authors of previous versions.
|
||||||
|
|
||||||
|
Some devices are designed to deny users access to install or run
|
||||||
|
modified versions of the software inside them, although the manufacturer
|
||||||
|
can do so. This is fundamentally incompatible with the aim of
|
||||||
|
protecting users' freedom to change the software. The systematic
|
||||||
|
pattern of such abuse occurs in the area of products for individuals to
|
||||||
|
use, which is precisely where it is most unacceptable. Therefore, we
|
||||||
|
have designed this version of the GPL to prohibit the practice for those
|
||||||
|
products. If such problems arise substantially in other domains, we
|
||||||
|
stand ready to extend this provision to those domains in future versions
|
||||||
|
of the GPL, as needed to protect the freedom of users.
|
||||||
|
|
||||||
|
Finally, every program is threatened constantly by software patents.
|
||||||
|
States should not allow patents to restrict development and use of
|
||||||
|
software on general-purpose computers, but in those that do, we wish to
|
||||||
|
avoid the special danger that patents applied to a free program could
|
||||||
|
make it effectively proprietary. To prevent this, the GPL assures that
|
||||||
|
patents cannot be used to render the program non-free.
|
||||||
|
|
||||||
|
The precise terms and conditions for copying, distribution and
|
||||||
|
modification follow.
|
||||||
|
|
||||||
|
TERMS AND CONDITIONS
|
||||||
|
|
||||||
|
0. Definitions.
|
||||||
|
|
||||||
|
"This License" refers to version 3 of the GNU General Public License.
|
||||||
|
|
||||||
|
"Copyright" also means copyright-like laws that apply to other kinds of
|
||||||
|
works, such as semiconductor masks.
|
||||||
|
|
||||||
|
"The Program" refers to any copyrightable work licensed under this
|
||||||
|
License. Each licensee is addressed as "you". "Licensees" and
|
||||||
|
"recipients" may be individuals or organizations.
|
||||||
|
|
||||||
|
To "modify" a work means to copy from or adapt all or part of the work
|
||||||
|
in a fashion requiring copyright permission, other than the making of an
|
||||||
|
exact copy. The resulting work is called a "modified version" of the
|
||||||
|
earlier work or a work "based on" the earlier work.
|
||||||
|
|
||||||
|
A "covered work" means either the unmodified Program or a work based
|
||||||
|
on the Program.
|
||||||
|
|
||||||
|
To "propagate" a work means to do anything with it that, without
|
||||||
|
permission, would make you directly or secondarily liable for
|
||||||
|
infringement under applicable copyright law, except executing it on a
|
||||||
|
computer or modifying a private copy. Propagation includes copying,
|
||||||
|
distribution (with or without modification), making available to the
|
||||||
|
public, and in some countries other activities as well.
|
||||||
|
|
||||||
|
To "convey" a work means any kind of propagation that enables other
|
||||||
|
parties to make or receive copies. Mere interaction with a user through
|
||||||
|
a computer network, with no transfer of a copy, is not conveying.
|
||||||
|
|
||||||
|
An interactive user interface displays "Appropriate Legal Notices"
|
||||||
|
to the extent that it includes a convenient and prominently visible
|
||||||
|
feature that (1) displays an appropriate copyright notice, and (2)
|
||||||
|
tells the user that there is no warranty for the work (except to the
|
||||||
|
extent that warranties are provided), that licensees may convey the
|
||||||
|
work under this License, and how to view a copy of this License. If
|
||||||
|
the interface presents a list of user commands or options, such as a
|
||||||
|
menu, a prominent item in the list meets this criterion.
|
||||||
|
|
||||||
|
1. Source Code.
|
||||||
|
|
||||||
|
The "source code" for a work means the preferred form of the work
|
||||||
|
for making modifications to it. "Object code" means any non-source
|
||||||
|
form of a work.
|
||||||
|
|
||||||
|
A "Standard Interface" means an interface that either is an official
|
||||||
|
standard defined by a recognized standards body, or, in the case of
|
||||||
|
interfaces specified for a particular programming language, one that
|
||||||
|
is widely used among developers working in that language.
|
||||||
|
|
||||||
|
The "System Libraries" of an executable work include anything, other
|
||||||
|
than the work as a whole, that (a) is included in the normal form of
|
||||||
|
packaging a Major Component, but which is not part of that Major
|
||||||
|
Component, and (b) serves only to enable use of the work with that
|
||||||
|
Major Component, or to implement a Standard Interface for which an
|
||||||
|
implementation is available to the public in source code form. A
|
||||||
|
"Major Component", in this context, means a major essential component
|
||||||
|
(kernel, window system, and so on) of the specific operating system
|
||||||
|
(if any) on which the executable work runs, or a compiler used to
|
||||||
|
produce the work, or an object code interpreter used to run it.
|
||||||
|
|
||||||
|
The "Corresponding Source" for a work in object code form means all
|
||||||
|
the source code needed to generate, install, and (for an executable
|
||||||
|
work) run the object code and to modify the work, including scripts to
|
||||||
|
control those activities. However, it does not include the work's
|
||||||
|
System Libraries, or general-purpose tools or generally available free
|
||||||
|
programs which are used unmodified in performing those activities but
|
||||||
|
which are not part of the work. For example, Corresponding Source
|
||||||
|
includes interface definition files associated with source files for
|
||||||
|
the work, and the source code for shared libraries and dynamically
|
||||||
|
linked subprograms that the work is specifically designed to require,
|
||||||
|
such as by intimate data communication or control flow between those
|
||||||
|
subprograms and other parts of the work.
|
||||||
|
|
||||||
|
The Corresponding Source need not include anything that users
|
||||||
|
can regenerate automatically from other parts of the Corresponding
|
||||||
|
Source.
|
||||||
|
|
||||||
|
The Corresponding Source for a work in source code form is that
|
||||||
|
same work.
|
||||||
|
|
||||||
|
2. Basic Permissions.
|
||||||
|
|
||||||
|
All rights granted under this License are granted for the term of
|
||||||
|
copyright on the Program, and are irrevocable provided the stated
|
||||||
|
conditions are met. This License explicitly affirms your unlimited
|
||||||
|
permission to run the unmodified Program. The output from running a
|
||||||
|
covered work is covered by this License only if the output, given its
|
||||||
|
content, constitutes a covered work. This License acknowledges your
|
||||||
|
rights of fair use or other equivalent, as provided by copyright law.
|
||||||
|
|
||||||
|
You may make, run and propagate covered works that you do not
|
||||||
|
convey, without conditions so long as your license otherwise remains
|
||||||
|
in force. You may convey covered works to others for the sole purpose
|
||||||
|
of having them make modifications exclusively for you, or provide you
|
||||||
|
with facilities for running those works, provided that you comply with
|
||||||
|
the terms of this License in conveying all material for which you do
|
||||||
|
not control copyright. Those thus making or running the covered works
|
||||||
|
for you must do so exclusively on your behalf, under your direction
|
||||||
|
and control, on terms that prohibit them from making any copies of
|
||||||
|
your copyrighted material outside their relationship with you.
|
||||||
|
|
||||||
|
Conveying under any other circumstances is permitted solely under
|
||||||
|
the conditions stated below. Sublicensing is not allowed; section 10
|
||||||
|
makes it unnecessary.
|
||||||
|
|
||||||
|
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
|
||||||
|
|
||||||
|
No covered work shall be deemed part of an effective technological
|
||||||
|
measure under any applicable law fulfilling obligations under article
|
||||||
|
11 of the WIPO copyright treaty adopted on 20 December 1996, or
|
||||||
|
similar laws prohibiting or restricting circumvention of such
|
||||||
|
measures.
|
||||||
|
|
||||||
|
When you convey a covered work, you waive any legal power to forbid
|
||||||
|
circumvention of technological measures to the extent such circumvention
|
||||||
|
is effected by exercising rights under this License with respect to
|
||||||
|
the covered work, and you disclaim any intention to limit operation or
|
||||||
|
modification of the work as a means of enforcing, against the work's
|
||||||
|
users, your or third parties' legal rights to forbid circumvention of
|
||||||
|
technological measures.
|
||||||
|
|
||||||
|
4. Conveying Verbatim Copies.
|
||||||
|
|
||||||
|
You may convey verbatim copies of the Program's source code as you
|
||||||
|
receive it, in any medium, provided that you conspicuously and
|
||||||
|
appropriately publish on each copy an appropriate copyright notice;
|
||||||
|
keep intact all notices stating that this License and any
|
||||||
|
non-permissive terms added in accord with section 7 apply to the code;
|
||||||
|
keep intact all notices of the absence of any warranty; and give all
|
||||||
|
recipients a copy of this License along with the Program.
|
||||||
|
|
||||||
|
You may charge any price or no price for each copy that you convey,
|
||||||
|
and you may offer support or warranty protection for a fee.
|
||||||
|
|
||||||
|
5. Conveying Modified Source Versions.
|
||||||
|
|
||||||
|
You may convey a work based on the Program, or the modifications to
|
||||||
|
produce it from the Program, in the form of source code under the
|
||||||
|
terms of section 4, provided that you also meet all of these conditions:
|
||||||
|
|
||||||
|
a) The work must carry prominent notices stating that you modified
|
||||||
|
it, and giving a relevant date.
|
||||||
|
|
||||||
|
b) The work must carry prominent notices stating that it is
|
||||||
|
released under this License and any conditions added under section
|
||||||
|
7. This requirement modifies the requirement in section 4 to
|
||||||
|
"keep intact all notices".
|
||||||
|
|
||||||
|
c) You must license the entire work, as a whole, under this
|
||||||
|
License to anyone who comes into possession of a copy. This
|
||||||
|
License will therefore apply, along with any applicable section 7
|
||||||
|
additional terms, to the whole of the work, and all its parts,
|
||||||
|
regardless of how they are packaged. This License gives no
|
||||||
|
permission to license the work in any other way, but it does not
|
||||||
|
invalidate such permission if you have separately received it.
|
||||||
|
|
||||||
|
d) If the work has interactive user interfaces, each must display
|
||||||
|
Appropriate Legal Notices; however, if the Program has interactive
|
||||||
|
interfaces that do not display Appropriate Legal Notices, your
|
||||||
|
work need not make them do so.
|
||||||
|
|
||||||
|
A compilation of a covered work with other separate and independent
|
||||||
|
works, which are not by their nature extensions of the covered work,
|
||||||
|
and which are not combined with it such as to form a larger program,
|
||||||
|
in or on a volume of a storage or distribution medium, is called an
|
||||||
|
"aggregate" if the compilation and its resulting copyright are not
|
||||||
|
used to limit the access or legal rights of the compilation's users
|
||||||
|
beyond what the individual works permit. Inclusion of a covered work
|
||||||
|
in an aggregate does not cause this License to apply to the other
|
||||||
|
parts of the aggregate.
|
||||||
|
|
||||||
|
6. Conveying Non-Source Forms.
|
||||||
|
|
||||||
|
You may convey a covered work in object code form under the terms
|
||||||
|
of sections 4 and 5, provided that you also convey the
|
||||||
|
machine-readable Corresponding Source under the terms of this License,
|
||||||
|
in one of these ways:
|
||||||
|
|
||||||
|
a) Convey the object code in, or embodied in, a physical product
|
||||||
|
(including a physical distribution medium), accompanied by the
|
||||||
|
Corresponding Source fixed on a durable physical medium
|
||||||
|
customarily used for software interchange.
|
||||||
|
|
||||||
|
b) Convey the object code in, or embodied in, a physical product
|
||||||
|
(including a physical distribution medium), accompanied by a
|
||||||
|
written offer, valid for at least three years and valid for as
|
||||||
|
long as you offer spare parts or customer support for that product
|
||||||
|
model, to give anyone who possesses the object code either (1) a
|
||||||
|
copy of the Corresponding Source for all the software in the
|
||||||
|
product that is covered by this License, on a durable physical
|
||||||
|
medium customarily used for software interchange, for a price no
|
||||||
|
more than your reasonable cost of physically performing this
|
||||||
|
conveying of source, or (2) access to copy the
|
||||||
|
Corresponding Source from a network server at no charge.
|
||||||
|
|
||||||
|
c) Convey individual copies of the object code with a copy of the
|
||||||
|
written offer to provide the Corresponding Source. This
|
||||||
|
alternative is allowed only occasionally and noncommercially, and
|
||||||
|
only if you received the object code with such an offer, in accord
|
||||||
|
with subsection 6b.
|
||||||
|
|
||||||
|
d) Convey the object code by offering access from a designated
|
||||||
|
place (gratis or for a charge), and offer equivalent access to the
|
||||||
|
Corresponding Source in the same way through the same place at no
|
||||||
|
further charge. You need not require recipients to copy the
|
||||||
|
Corresponding Source along with the object code. If the place to
|
||||||
|
copy the object code is a network server, the Corresponding Source
|
||||||
|
may be on a different server (operated by you or a third party)
|
||||||
|
that supports equivalent copying facilities, provided you maintain
|
||||||
|
clear directions next to the object code saying where to find the
|
||||||
|
Corresponding Source. Regardless of what server hosts the
|
||||||
|
Corresponding Source, you remain obligated to ensure that it is
|
||||||
|
available for as long as needed to satisfy these requirements.
|
||||||
|
|
||||||
|
e) Convey the object code using peer-to-peer transmission, provided
|
||||||
|
you inform other peers where the object code and Corresponding
|
||||||
|
Source of the work are being offered to the general public at no
|
||||||
|
charge under subsection 6d.
|
||||||
|
|
||||||
|
A separable portion of the object code, whose source code is excluded
|
||||||
|
from the Corresponding Source as a System Library, need not be
|
||||||
|
included in conveying the object code work.
|
||||||
|
|
||||||
|
A "User Product" is either (1) a "consumer product", which means any
|
||||||
|
tangible personal property which is normally used for personal, family,
|
||||||
|
or household purposes, or (2) anything designed or sold for incorporation
|
||||||
|
into a dwelling. In determining whether a product is a consumer product,
|
||||||
|
doubtful cases shall be resolved in favor of coverage. For a particular
|
||||||
|
product received by a particular user, "normally used" refers to a
|
||||||
|
typical or common use of that class of product, regardless of the status
|
||||||
|
of the particular user or of the way in which the particular user
|
||||||
|
actually uses, or expects or is expected to use, the product. A product
|
||||||
|
is a consumer product regardless of whether the product has substantial
|
||||||
|
commercial, industrial or non-consumer uses, unless such uses represent
|
||||||
|
the only significant mode of use of the product.
|
||||||
|
|
||||||
|
"Installation Information" for a User Product means any methods,
|
||||||
|
procedures, authorization keys, or other information required to install
|
||||||
|
and execute modified versions of a covered work in that User Product from
|
||||||
|
a modified version of its Corresponding Source. The information must
|
||||||
|
suffice to ensure that the continued functioning of the modified object
|
||||||
|
code is in no case prevented or interfered with solely because
|
||||||
|
modification has been made.
|
||||||
|
|
||||||
|
If you convey an object code work under this section in, or with, or
|
||||||
|
specifically for use in, a User Product, and the conveying occurs as
|
||||||
|
part of a transaction in which the right of possession and use of the
|
||||||
|
User Product is transferred to the recipient in perpetuity or for a
|
||||||
|
fixed term (regardless of how the transaction is characterized), the
|
||||||
|
Corresponding Source conveyed under this section must be accompanied
|
||||||
|
by the Installation Information. But this requirement does not apply
|
||||||
|
if neither you nor any third party retains the ability to install
|
||||||
|
modified object code on the User Product (for example, the work has
|
||||||
|
been installed in ROM).
|
||||||
|
|
||||||
|
The requirement to provide Installation Information does not include a
|
||||||
|
requirement to continue to provide support service, warranty, or updates
|
||||||
|
for a work that has been modified or installed by the recipient, or for
|
||||||
|
the User Product in which it has been modified or installed. Access to a
|
||||||
|
network may be denied when the modification itself materially and
|
||||||
|
adversely affects the operation of the network or violates the rules and
|
||||||
|
protocols for communication across the network.
|
||||||
|
|
||||||
|
Corresponding Source conveyed, and Installation Information provided,
|
||||||
|
in accord with this section must be in a format that is publicly
|
||||||
|
documented (and with an implementation available to the public in
|
||||||
|
source code form), and must require no special password or key for
|
||||||
|
unpacking, reading or copying.
|
||||||
|
|
||||||
|
7. Additional Terms.
|
||||||
|
|
||||||
|
"Additional permissions" are terms that supplement the terms of this
|
||||||
|
License by making exceptions from one or more of its conditions.
|
||||||
|
Additional permissions that are applicable to the entire Program shall
|
||||||
|
be treated as though they were included in this License, to the extent
|
||||||
|
that they are valid under applicable law. If additional permissions
|
||||||
|
apply only to part of the Program, that part may be used separately
|
||||||
|
under those permissions, but the entire Program remains governed by
|
||||||
|
this License without regard to the additional permissions.
|
||||||
|
|
||||||
|
When you convey a copy of a covered work, you may at your option
|
||||||
|
remove any additional permissions from that copy, or from any part of
|
||||||
|
it. (Additional permissions may be written to require their own
|
||||||
|
removal in certain cases when you modify the work.) You may place
|
||||||
|
additional permissions on material, added by you to a covered work,
|
||||||
|
for which you have or can give appropriate copyright permission.
|
||||||
|
|
||||||
|
Notwithstanding any other provision of this License, for material you
|
||||||
|
add to a covered work, you may (if authorized by the copyright holders of
|
||||||
|
that material) supplement the terms of this License with terms:
|
||||||
|
|
||||||
|
a) Disclaiming warranty or limiting liability differently from the
|
||||||
|
terms of sections 15 and 16 of this License; or
|
||||||
|
|
||||||
|
b) Requiring preservation of specified reasonable legal notices or
|
||||||
|
author attributions in that material or in the Appropriate Legal
|
||||||
|
Notices displayed by works containing it; or
|
||||||
|
|
||||||
|
c) Prohibiting misrepresentation of the origin of that material, or
|
||||||
|
requiring that modified versions of such material be marked in
|
||||||
|
reasonable ways as different from the original version; or
|
||||||
|
|
||||||
|
d) Limiting the use for publicity purposes of names of licensors or
|
||||||
|
authors of the material; or
|
||||||
|
|
||||||
|
e) Declining to grant rights under trademark law for use of some
|
||||||
|
trade names, trademarks, or service marks; or
|
||||||
|
|
||||||
|
f) Requiring indemnification of licensors and authors of that
|
||||||
|
material by anyone who conveys the material (or modified versions of
|
||||||
|
it) with contractual assumptions of liability to the recipient, for
|
||||||
|
any liability that these contractual assumptions directly impose on
|
||||||
|
those licensors and authors.
|
||||||
|
|
||||||
|
All other non-permissive additional terms are considered "further
|
||||||
|
restrictions" within the meaning of section 10. If the Program as you
|
||||||
|
received it, or any part of it, contains a notice stating that it is
|
||||||
|
governed by this License along with a term that is a further
|
||||||
|
restriction, you may remove that term. If a license document contains
|
||||||
|
a further restriction but permits relicensing or conveying under this
|
||||||
|
License, you may add to a covered work material governed by the terms
|
||||||
|
of that license document, provided that the further restriction does
|
||||||
|
not survive such relicensing or conveying.
|
||||||
|
|
||||||
|
If you add terms to a covered work in accord with this section, you
|
||||||
|
must place, in the relevant source files, a statement of the
|
||||||
|
additional terms that apply to those files, or a notice indicating
|
||||||
|
where to find the applicable terms.
|
||||||
|
|
||||||
|
Additional terms, permissive or non-permissive, may be stated in the
|
||||||
|
form of a separately written license, or stated as exceptions;
|
||||||
|
the above requirements apply either way.
|
||||||
|
|
||||||
|
8. Termination.
|
||||||
|
|
||||||
|
You may not propagate or modify a covered work except as expressly
|
||||||
|
provided under this License. Any attempt otherwise to propagate or
|
||||||
|
modify it is void, and will automatically terminate your rights under
|
||||||
|
this License (including any patent licenses granted under the third
|
||||||
|
paragraph of section 11).
|
||||||
|
|
||||||
|
However, if you cease all violation of this License, then your
|
||||||
|
license from a particular copyright holder is reinstated (a)
|
||||||
|
provisionally, unless and until the copyright holder explicitly and
|
||||||
|
finally terminates your license, and (b) permanently, if the copyright
|
||||||
|
holder fails to notify you of the violation by some reasonable means
|
||||||
|
prior to 60 days after the cessation.
|
||||||
|
|
||||||
|
Moreover, your license from a particular copyright holder is
|
||||||
|
reinstated permanently if the copyright holder notifies you of the
|
||||||
|
violation by some reasonable means, this is the first time you have
|
||||||
|
received notice of violation of this License (for any work) from that
|
||||||
|
copyright holder, and you cure the violation prior to 30 days after
|
||||||
|
your receipt of the notice.
|
||||||
|
|
||||||
|
Termination of your rights under this section does not terminate the
|
||||||
|
licenses of parties who have received copies or rights from you under
|
||||||
|
this License. If your rights have been terminated and not permanently
|
||||||
|
reinstated, you do not qualify to receive new licenses for the same
|
||||||
|
material under section 10.
|
||||||
|
|
||||||
|
9. Acceptance Not Required for Having Copies.
|
||||||
|
|
||||||
|
You are not required to accept this License in order to receive or
|
||||||
|
run a copy of the Program. Ancillary propagation of a covered work
|
||||||
|
occurring solely as a consequence of using peer-to-peer transmission
|
||||||
|
to receive a copy likewise does not require acceptance. However,
|
||||||
|
nothing other than this License grants you permission to propagate or
|
||||||
|
modify any covered work. These actions infringe copyright if you do
|
||||||
|
not accept this License. Therefore, by modifying or propagating a
|
||||||
|
covered work, you indicate your acceptance of this License to do so.
|
||||||
|
|
||||||
|
10. Automatic Licensing of Downstream Recipients.
|
||||||
|
|
||||||
|
Each time you convey a covered work, the recipient automatically
|
||||||
|
receives a license from the original licensors, to run, modify and
|
||||||
|
propagate that work, subject to this License. You are not responsible
|
||||||
|
for enforcing compliance by third parties with this License.
|
||||||
|
|
||||||
|
An "entity transaction" is a transaction transferring control of an
|
||||||
|
organization, or substantially all assets of one, or subdividing an
|
||||||
|
organization, or merging organizations. If propagation of a covered
|
||||||
|
work results from an entity transaction, each party to that
|
||||||
|
transaction who receives a copy of the work also receives whatever
|
||||||
|
licenses to the work the party's predecessor in interest had or could
|
||||||
|
give under the previous paragraph, plus a right to possession of the
|
||||||
|
Corresponding Source of the work from the predecessor in interest, if
|
||||||
|
the predecessor has it or can get it with reasonable efforts.
|
||||||
|
|
||||||
|
You may not impose any further restrictions on the exercise of the
|
||||||
|
rights granted or affirmed under this License. For example, you may
|
||||||
|
not impose a license fee, royalty, or other charge for exercise of
|
||||||
|
rights granted under this License, and you may not initiate litigation
|
||||||
|
(including a cross-claim or counterclaim in a lawsuit) alleging that
|
||||||
|
any patent claim is infringed by making, using, selling, offering for
|
||||||
|
sale, or importing the Program or any portion of it.
|
||||||
|
|
||||||
|
11. Patents.
|
||||||
|
|
||||||
|
A "contributor" is a copyright holder who authorizes use under this
|
||||||
|
License of the Program or a work on which the Program is based. The
|
||||||
|
work thus licensed is called the contributor's "contributor version".
|
||||||
|
|
||||||
|
A contributor's "essential patent claims" are all patent claims
|
||||||
|
owned or controlled by the contributor, whether already acquired or
|
||||||
|
hereafter acquired, that would be infringed by some manner, permitted
|
||||||
|
by this License, of making, using, or selling its contributor version,
|
||||||
|
but do not include claims that would be infringed only as a
|
||||||
|
consequence of further modification of the contributor version. For
|
||||||
|
purposes of this definition, "control" includes the right to grant
|
||||||
|
patent sublicenses in a manner consistent with the requirements of
|
||||||
|
this License.
|
||||||
|
|
||||||
|
Each contributor grants you a non-exclusive, worldwide, royalty-free
|
||||||
|
patent license under the contributor's essential patent claims, to
|
||||||
|
make, use, sell, offer for sale, import and otherwise run, modify and
|
||||||
|
propagate the contents of its contributor version.
|
||||||
|
|
||||||
|
In the following three paragraphs, a "patent license" is any express
|
||||||
|
agreement or commitment, however denominated, not to enforce a patent
|
||||||
|
(such as an express permission to practice a patent or covenant not to
|
||||||
|
sue for patent infringement). To "grant" such a patent license to a
|
||||||
|
party means to make such an agreement or commitment not to enforce a
|
||||||
|
patent against the party.
|
||||||
|
|
||||||
|
If you convey a covered work, knowingly relying on a patent license,
|
||||||
|
and the Corresponding Source of the work is not available for anyone
|
||||||
|
to copy, free of charge and under the terms of this License, through a
|
||||||
|
publicly available network server or other readily accessible means,
|
||||||
|
then you must either (1) cause the Corresponding Source to be so
|
||||||
|
available, or (2) arrange to deprive yourself of the benefit of the
|
||||||
|
patent license for this particular work, or (3) arrange, in a manner
|
||||||
|
consistent with the requirements of this License, to extend the patent
|
||||||
|
license to downstream recipients. "Knowingly relying" means you have
|
||||||
|
actual knowledge that, but for the patent license, your conveying the
|
||||||
|
covered work in a country, or your recipient's use of the covered work
|
||||||
|
in a country, would infringe one or more identifiable patents in that
|
||||||
|
country that you have reason to believe are valid.
|
||||||
|
|
||||||
|
If, pursuant to or in connection with a single transaction or
|
||||||
|
arrangement, you convey, or propagate by procuring conveyance of, a
|
||||||
|
covered work, and grant a patent license to some of the parties
|
||||||
|
receiving the covered work authorizing them to use, propagate, modify
|
||||||
|
or convey a specific copy of the covered work, then the patent license
|
||||||
|
you grant is automatically extended to all recipients of the covered
|
||||||
|
work and works based on it.
|
||||||
|
|
||||||
|
A patent license is "discriminatory" if it does not include within
|
||||||
|
the scope of its coverage, prohibits the exercise of, or is
|
||||||
|
conditioned on the non-exercise of one or more of the rights that are
|
||||||
|
specifically granted under this License. You may not convey a covered
|
||||||
|
work if you are a party to an arrangement with a third party that is
|
||||||
|
in the business of distributing software, under which you make payment
|
||||||
|
to the third party based on the extent of your activity of conveying
|
||||||
|
the work, and under which the third party grants, to any of the
|
||||||
|
parties who would receive the covered work from you, a discriminatory
|
||||||
|
patent license (a) in connection with copies of the covered work
|
||||||
|
conveyed by you (or copies made from those copies), or (b) primarily
|
||||||
|
for and in connection with specific products or compilations that
|
||||||
|
contain the covered work, unless you entered into that arrangement,
|
||||||
|
or that patent license was granted, prior to 28 March 2007.
|
||||||
|
|
||||||
|
Nothing in this License shall be construed as excluding or limiting
|
||||||
|
any implied license or other defenses to infringement that may
|
||||||
|
otherwise be available to you under applicable patent law.
|
||||||
|
|
||||||
|
12. No Surrender of Others' Freedom.
|
||||||
|
|
||||||
|
If conditions are imposed on you (whether by court order, agreement or
|
||||||
|
otherwise) that contradict the conditions of this License, they do not
|
||||||
|
excuse you from the conditions of this License. If you cannot convey a
|
||||||
|
covered work so as to satisfy simultaneously your obligations under this
|
||||||
|
License and any other pertinent obligations, then as a consequence you may
|
||||||
|
not convey it at all. For example, if you agree to terms that obligate you
|
||||||
|
to collect a royalty for further conveying from those to whom you convey
|
||||||
|
the Program, the only way you could satisfy both those terms and this
|
||||||
|
License would be to refrain entirely from conveying the Program.
|
||||||
|
|
||||||
|
13. Use with the GNU Affero General Public License.
|
||||||
|
|
||||||
|
Notwithstanding any other provision of this License, you have
|
||||||
|
permission to link or combine any covered work with a work licensed
|
||||||
|
under version 3 of the GNU Affero General Public License into a single
|
||||||
|
combined work, and to convey the resulting work. The terms of this
|
||||||
|
License will continue to apply to the part which is the covered work,
|
||||||
|
but the special requirements of the GNU Affero General Public License,
|
||||||
|
section 13, concerning interaction through a network will apply to the
|
||||||
|
combination as such.
|
||||||
|
|
||||||
|
14. Revised Versions of this License.
|
||||||
|
|
||||||
|
The Free Software Foundation may publish revised and/or new versions of
|
||||||
|
the GNU General Public License from time to time. Such new versions will
|
||||||
|
be similar in spirit to the present version, but may differ in detail to
|
||||||
|
address new problems or concerns.
|
||||||
|
|
||||||
|
Each version is given a distinguishing version number. If the
|
||||||
|
Program specifies that a certain numbered version of the GNU General
|
||||||
|
Public License "or any later version" applies to it, you have the
|
||||||
|
option of following the terms and conditions either of that numbered
|
||||||
|
version or of any later version published by the Free Software
|
||||||
|
Foundation. If the Program does not specify a version number of the
|
||||||
|
GNU General Public License, you may choose any version ever published
|
||||||
|
by the Free Software Foundation.
|
||||||
|
|
||||||
|
If the Program specifies that a proxy can decide which future
|
||||||
|
versions of the GNU General Public License can be used, that proxy's
|
||||||
|
public statement of acceptance of a version permanently authorizes you
|
||||||
|
to choose that version for the Program.
|
||||||
|
|
||||||
|
Later license versions may give you additional or different
|
||||||
|
permissions. However, no additional obligations are imposed on any
|
||||||
|
author or copyright holder as a result of your choosing to follow a
|
||||||
|
later version.
|
||||||
|
|
||||||
|
15. Disclaimer of Warranty.
|
||||||
|
|
||||||
|
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
|
||||||
|
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
|
||||||
|
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
|
||||||
|
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
|
||||||
|
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||||
|
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
|
||||||
|
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
|
||||||
|
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
|
||||||
|
|
||||||
|
16. Limitation of Liability.
|
||||||
|
|
||||||
|
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
|
||||||
|
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
|
||||||
|
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
|
||||||
|
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
|
||||||
|
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
|
||||||
|
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
|
||||||
|
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
|
||||||
|
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
|
||||||
|
SUCH DAMAGES.
|
||||||
|
|
||||||
|
17. Interpretation of Sections 15 and 16.
|
||||||
|
|
||||||
|
If the disclaimer of warranty and limitation of liability provided
|
||||||
|
above cannot be given local legal effect according to their terms,
|
||||||
|
reviewing courts shall apply local law that most closely approximates
|
||||||
|
an absolute waiver of all civil liability in connection with the
|
||||||
|
Program, unless a warranty or assumption of liability accompanies a
|
||||||
|
copy of the Program in return for a fee.
|
||||||
|
|
||||||
|
END OF TERMS AND CONDITIONS
|
||||||
|
|
||||||
|
How to Apply These Terms to Your New Programs
|
||||||
|
|
||||||
|
If you develop a new program, and you want it to be of the greatest
|
||||||
|
possible use to the public, the best way to achieve this is to make it
|
||||||
|
free software which everyone can redistribute and change under these terms.
|
||||||
|
|
||||||
|
To do so, attach the following notices to the program. It is safest
|
||||||
|
to attach them to the start of each source file to most effectively
|
||||||
|
state the exclusion of warranty; and each file should have at least
|
||||||
|
the "copyright" line and a pointer to where the full notice is found.
|
||||||
|
|
||||||
|
<one line to give the program's name and a brief idea of what it does.>
|
||||||
|
Copyright (C) <year> <name of author>
|
||||||
|
|
||||||
|
This program is free software: you can redistribute it and/or modify
|
||||||
|
it under the terms of the GNU General Public License as published by
|
||||||
|
the Free Software Foundation, either version 3 of the License, or
|
||||||
|
(at your option) any later version.
|
||||||
|
|
||||||
|
This program is distributed in the hope that it will be useful,
|
||||||
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
GNU General Public License for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU General Public License
|
||||||
|
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
Also add information on how to contact you by electronic and paper mail.
|
||||||
|
|
||||||
|
If the program does terminal interaction, make it output a short
|
||||||
|
notice like this when it starts in an interactive mode:
|
||||||
|
|
||||||
|
<program> Copyright (C) <year> <name of author>
|
||||||
|
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
|
||||||
|
This is free software, and you are welcome to redistribute it
|
||||||
|
under certain conditions; type `show c' for details.
|
||||||
|
|
||||||
|
The hypothetical commands `show w' and `show c' should show the appropriate
|
||||||
|
parts of the General Public License. Of course, your program's commands
|
||||||
|
might be different; for a GUI interface, you would use an "about box".
|
||||||
|
|
||||||
|
You should also get your employer (if you work as a programmer) or school,
|
||||||
|
if any, to sign a "copyright disclaimer" for the program, if necessary.
|
||||||
|
For more information on this, and how to apply and follow the GNU GPL, see
|
||||||
|
<http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
The GNU General Public License does not permit incorporating your program
|
||||||
|
into proprietary programs. If your program is a subroutine library, you
|
||||||
|
may consider it more useful to permit linking proprietary applications with
|
||||||
|
the library. If this is what you want to do, use the GNU Lesser General
|
||||||
|
Public License instead of this License. But first, please read
|
||||||
|
<http://www.gnu.org/philosophy/why-not-lgpl.html>.
|
@@ -1,4 +1,4 @@
|
|||||||
This project has history of over 17 years spanning back to Python 1.5
|
This project has history of over 18 years spanning back to Python 1.5
|
||||||
|
|
||||||
There have been a number of people who have worked on this. I am awed
|
There have been a number of people who have worked on this. I am awed
|
||||||
by the amount of work, number of people who have contributed to this,
|
by the amount of work, number of people who have contributed to this,
|
||||||
|
@@ -33,7 +33,7 @@ prescribed cases, the ill-defined amorphous cases as well will get
|
|||||||
handled as well.
|
handled as well.
|
||||||
|
|
||||||
In sum, you may need to do some work to have the bug you have found
|
In sum, you may need to do some work to have the bug you have found
|
||||||
handled before the hundreds of other bugs, and things I could be
|
handled before the hundreds of other bugs, and other things I could be
|
||||||
doing.
|
doing.
|
||||||
|
|
||||||
No one is getting paid to work to work on this project, let alone the
|
No one is getting paid to work to work on this project, let alone the
|
||||||
@@ -57,6 +57,19 @@ disassembler called `pydisasm`.
|
|||||||
|
|
||||||
### Semantic equivalence vs. exact source code
|
### Semantic equivalence vs. exact source code
|
||||||
|
|
||||||
|
Consider how Python compiles something like "(x*y) + 5". Early on
|
||||||
|
Python creates an "abstract syntax tree" (AST) for this. And this is
|
||||||
|
"abstract" in the sense that unimportant, redundant or unnecceary
|
||||||
|
items have been removed. Here, this means that any notion that you
|
||||||
|
wrote "x+y" in parenthesis is lost, since in this context they are
|
||||||
|
unneeded. Also lost is the fact that the multiplication didn't have
|
||||||
|
spaces around it while the addition did. It should not come as a
|
||||||
|
surprise then that the bytecode which is derived from the AST also has
|
||||||
|
no notion of such possible variation. Generally this kind of thing
|
||||||
|
isn't noticed since the Python community has laid out a very rigid set
|
||||||
|
of formatting guidelines; and it has largely beaten the community into
|
||||||
|
compliance.
|
||||||
|
|
||||||
Almost all versions of Python can perform some sort of code
|
Almost all versions of Python can perform some sort of code
|
||||||
improvement that can't be undone. In earlier versions of Python it is
|
improvement that can't be undone. In earlier versions of Python it is
|
||||||
rare; in later Python versions, it is more common.
|
rare; in later Python versions, it is more common.
|
||||||
@@ -66,7 +79,7 @@ If the code emitted is semantically equivalent, then this isn't a bug.
|
|||||||
|
|
||||||
For example the code might be
|
For example the code might be
|
||||||
|
|
||||||
```
|
```python
|
||||||
if a:
|
if a:
|
||||||
if b:
|
if b:
|
||||||
x = 1
|
x = 1
|
||||||
@@ -74,7 +87,7 @@ if a:
|
|||||||
|
|
||||||
and we might produce:
|
and we might produce:
|
||||||
|
|
||||||
```
|
```python
|
||||||
if a and b:
|
if a and b:
|
||||||
x = 1
|
x = 1
|
||||||
```
|
```
|
||||||
@@ -87,24 +100,35 @@ else:
|
|||||||
|
|
||||||
```
|
```
|
||||||
|
|
||||||
may come out as `elif`.
|
may come out as `elif` or vice versa.
|
||||||
|
|
||||||
|
|
||||||
As mentioned in the README, It is possible that Python changes what
|
As mentioned in the README, It is possible that Python changes what
|
||||||
you write to be more efficient. For example, for:
|
you write to be more efficient. For example, for:
|
||||||
|
|
||||||
|
|
||||||
```
|
```python
|
||||||
if True:
|
if True:
|
||||||
x = 5
|
x = 5
|
||||||
```
|
```
|
||||||
|
|
||||||
Python will generate code like:
|
Python will generate code like:
|
||||||
|
|
||||||
```
|
```python
|
||||||
x = 5
|
x = 5
|
||||||
```
|
```
|
||||||
|
|
||||||
|
Even more extreme, if your code is:
|
||||||
|
|
||||||
|
```python
|
||||||
|
if False:
|
||||||
|
x = 1
|
||||||
|
y = 2
|
||||||
|
# ...
|
||||||
|
```
|
||||||
|
|
||||||
|
Python will eliminate the entire "if" statement.
|
||||||
|
|
||||||
So just because the text isn't the same, does not
|
So just because the text isn't the same, does not
|
||||||
necessarily mean there's a bug.
|
necessarily mean there's a bug.
|
||||||
|
|
||||||
|
22
LICENSE
22
LICENSE
@@ -1,22 +0,0 @@
|
|||||||
Copyright (c) 2015 by Rocky Bernstein
|
|
||||||
Copyright (c) 2000 by hartmut Goebel <h.goebel@crazy-compilers.com>
|
|
||||||
Copyright (c) 1998-2002 John Aycock
|
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining
|
|
||||||
a copy of this software and associated documentation files (the
|
|
||||||
"Software"), to deal in the Software without restriction, including
|
|
||||||
without limitation the rights to use, copy, modify, merge, publish,
|
|
||||||
distribute, sublicense, and/or sell copies of the Software, and to
|
|
||||||
permit persons to whom the Software is furnished to do so, subject to
|
|
||||||
the following conditions:
|
|
||||||
|
|
||||||
The above copyright notice and this permission notice shall be
|
|
||||||
included in all copies or substantial portions of the Software.
|
|
||||||
|
|
||||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
|
||||||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
|
||||||
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
|
||||||
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
|
||||||
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
|
||||||
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
|
||||||
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
@@ -2,7 +2,7 @@ include README.rst
|
|||||||
include ChangeLog
|
include ChangeLog
|
||||||
include HISTORY.md
|
include HISTORY.md
|
||||||
include HOW-TO-REPORT-A-BUG.md
|
include HOW-TO-REPORT-A-BUG.md
|
||||||
include LICENSE
|
include COPYING
|
||||||
include Makefile
|
include Makefile
|
||||||
include requirements.txt
|
include requirements.txt
|
||||||
include requirements-dev.txt
|
include requirements-dev.txt
|
||||||
|
10
Makefile
10
Makefile
@@ -27,20 +27,18 @@ check:
|
|||||||
check-short: pytest
|
check-short: pytest
|
||||||
$(MAKE) -C test check-short
|
$(MAKE) -C test check-short
|
||||||
|
|
||||||
|
# Note for 2.6 use <=3.0.1 see requirements-dev.txt
|
||||||
#: Tests for Python 2.7, 3.3 and 3.4
|
#: Tests for Python 2.7, 3.3 and 3.4
|
||||||
check-2.7 check-3.3 check-3.4: pytest
|
check-2.6 check-2.7 check-3.3 check-3.4 check-3.5: pytest
|
||||||
$(MAKE) -C test $@
|
$(MAKE) -C test $@
|
||||||
|
|
||||||
#: Tests for Python 3.2 and 3.5 - pytest doesn't work here
|
#: Tests for Python 3.2 and 3.5 - pytest doesn't work here
|
||||||
# Or rather 3.5 doesn't work not on Travis
|
# Or rather 3.5 doesn't work not on Travis
|
||||||
check-3.0 check-3.1 check-3.2 check-3.5 check-3.6:
|
check-3.0 check-3.1 check-3.2 check-3.6:
|
||||||
$(MAKE) -C test $@
|
$(MAKE) -C test $@
|
||||||
|
|
||||||
check-3.7: pytest
|
check-3.7: pytest
|
||||||
|
$(MAKE) -C test check
|
||||||
#:Tests for Python 2.6 (doesn't have pytest)
|
|
||||||
check-2.6:
|
|
||||||
$(MAKE) -C test $@
|
|
||||||
|
|
||||||
#:PyPy 2.6.1 PyPy 5.0.1, or PyPy 5.8.0-beta0
|
#:PyPy 2.6.1 PyPy 5.0.1, or PyPy 5.8.0-beta0
|
||||||
# Skip for now
|
# Skip for now
|
||||||
|
111
NEWS
111
NEWS
@@ -1,3 +1,96 @@
|
|||||||
|
uncompyle6 3.2.4 2018-06-04 7x9 release
|
||||||
|
|
||||||
|
- Bug fixes #180, #182, #187, #192
|
||||||
|
- Enhancements #189
|
||||||
|
- Internal improvements
|
||||||
|
|
||||||
|
uncompyle6 3.2.3 2018-06-04 Michael Cohen flips and Fleetwood Redux
|
||||||
|
|
||||||
|
- Python 1.3 support 3.0 bug and
|
||||||
|
- fix botched parameter ordering of 3.x in last release
|
||||||
|
|
||||||
|
uncompyle6 3.2.2 2018-06-04 When I'm 64
|
||||||
|
|
||||||
|
- Python 3.0 support and bug fixes
|
||||||
|
|
||||||
|
uncompyle6 3.2.1 2018-06-04 MF
|
||||||
|
|
||||||
|
- Python 1.4 and 1.5 bug fixes
|
||||||
|
|
||||||
|
uncompyle6 3.2.0 2018-05-19 Rocket Scientist
|
||||||
|
|
||||||
|
- 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)
|
||||||
|
- bug fixes, especially for 3.7 (but 2.7 and 3.6 and others as well)
|
||||||
|
|
||||||
|
uncompyle6 3.1.3 2018-04-16
|
||||||
|
|
||||||
|
- Add some Python 3.7 rules, such as for handling LOAD_METHOD (not complete)
|
||||||
|
- Fix some fragment bugs
|
||||||
|
- small doc changes
|
||||||
|
|
||||||
|
uncompyle6 3.1.2 2018-04-08 Eastern Orthodox Easter
|
||||||
|
|
||||||
|
- Python 3.x subclass and call parsing fixes
|
||||||
|
- Allow/note running on Python 3.1
|
||||||
|
- improve 3.5+ BUILD_MAP_UNPACK
|
||||||
|
- DRY instruction building code between 2.x and 3.x
|
||||||
|
- expand testing
|
||||||
|
|
||||||
|
uncompyle6 3.1.1 2018-04-01 Easter April Fool's
|
||||||
|
|
||||||
|
Jesus on Friday's New York Times puzzle: "I'm stuck on 2A"
|
||||||
|
|
||||||
|
- fill out 3.5+ BUILD_MAP_UNPACK (more work is needed)
|
||||||
|
- fill out 3.4+ CALL_FUNCTION_... (more work is needed)
|
||||||
|
- fill out 3.5 MAKE_FUNCTION (more work is needed)
|
||||||
|
- reduce 3.5, 3.6 control-flow bugs
|
||||||
|
- reduce ambiguity in rules that lead to long (exponential?) parses
|
||||||
|
- limit/isolate some 2.6/2.7,3.x grammar rules
|
||||||
|
- more runtime testing of decompiled code
|
||||||
|
- more removal of parenthesis around calls via setting precidence
|
||||||
|
|
||||||
|
uncompyle6 3.1.0 2018-03-21 Equinox
|
||||||
|
|
||||||
|
- Add code_deparse_with_offset() fragment function.
|
||||||
|
- Correct paramenter call fragment deparse_code()
|
||||||
|
- Lots of 3.6, 3.x, and 2.7 bug fixes
|
||||||
|
About 5% of 3.6 fail parsing now. But
|
||||||
|
semantics still needs much to be desired.
|
||||||
|
|
||||||
|
uncompyle6 3.0.1 2018-02-17
|
||||||
|
|
||||||
|
- All Python 2.6.9 standard library files weakly verify
|
||||||
|
- Many 3.6 fixes. 84% of the first 200 standard library files weakly compile.
|
||||||
|
One more big push is needed to get the remaining to compile
|
||||||
|
- Many decompilation fixes for other Python versions
|
||||||
|
- Add more to the test framework
|
||||||
|
- And more add tests target previous existing bugs more completely
|
||||||
|
- sync recent license changes in metadata
|
||||||
|
|
||||||
|
uncompyle6 3.0.0 2018-02-17
|
||||||
|
|
||||||
|
- deparse_code() and lookalikes from the various semantic actions are
|
||||||
|
now deprecated. Instead use new API code_deparse() which makes the
|
||||||
|
version optional and bundles debug options into a dictionary.
|
||||||
|
- License changed to GPL3.
|
||||||
|
- Many Python 3.6 fixes, especially around handling EXTENDED_ARGS
|
||||||
|
Due to the reduction in operand size for JUMP's there are many
|
||||||
|
more EXTENDED_ARGS instructions which can be the targets
|
||||||
|
of jumps, and messes up the peephole-like analysis that is
|
||||||
|
done for control flow since we don't have something better in place.
|
||||||
|
- Code has been reorganized to be more instruction nametuple based where it
|
||||||
|
has been more bytecode array based. There was and still is code that had
|
||||||
|
had magic numbers to advance instructions or to pick out operands.
|
||||||
|
- Bug fixes in numerous other Python versions
|
||||||
|
- Instruction display improved
|
||||||
|
- Keep global statements in fixed order (from wangym5106)
|
||||||
|
|
||||||
|
A bit more work is still needed for 3.6 especially in the area of
|
||||||
|
function calls and definitions.
|
||||||
|
|
||||||
|
|
||||||
uncompyle6 2.16.0 2018-02-17
|
uncompyle6 2.16.0 2018-02-17
|
||||||
|
|
||||||
- API additions:
|
- API additions:
|
||||||
@@ -6,7 +99,7 @@ uncompyle6 2.16.0 2018-02-17
|
|||||||
- Better 2.7 end_if and COME_FROM determination
|
- Better 2.7 end_if and COME_FROM determination
|
||||||
- Fix up 3.6+ CALL_FUNCTION_EX
|
- Fix up 3.6+ CALL_FUNCTION_EX
|
||||||
- Misc pydisasm fixes
|
- Misc pydisasm fixes
|
||||||
- Wierd comprehension bug seen via new loctraceback
|
- Weird comprehension bug seen via new loctraceback
|
||||||
- Fix Python 3.5+ CALL_FUNCTION_VAR and BUILD_LIST_UNPACK in call; with this
|
- Fix Python 3.5+ CALL_FUNCTION_VAR and BUILD_LIST_UNPACK in call; with this
|
||||||
we can can handle 3.5+ f(a, b, *c, *d, *e) now
|
we can can handle 3.5+ f(a, b, *c, *d, *e) now
|
||||||
|
|
||||||
@@ -59,7 +152,7 @@ Decompilation bug fixes, mostly 3.6 and pre 2.7
|
|||||||
- limit pypy customization to pypy
|
- limit pypy customization to pypy
|
||||||
- Add addr fields in COME_FROMS
|
- Add addr fields in COME_FROMS
|
||||||
- Allow use of full instructions in parser reduction routines
|
- Allow use of full instructions in parser reduction routines
|
||||||
- Reduce grammar in Pythion 3 by specialization more to specific
|
- Reduce grammar in Python 3 by specialization more to specific
|
||||||
Python versions
|
Python versions
|
||||||
- Match Python AST names more closely when possible
|
- Match Python AST names more closely when possible
|
||||||
|
|
||||||
@@ -77,7 +170,7 @@ uncompyle6 2.14.0 2017-11-26 johnnybamazing
|
|||||||
and remove used grammar rules
|
and remove used grammar rules
|
||||||
- Fix a number of bytecode decompile problems
|
- Fix a number of bytecode decompile problems
|
||||||
(many more remain)
|
(many more remain)
|
||||||
- Add stdlib/runtests.sh for even more rigourous testing
|
- Add stdlib/runtests.sh for even more rigorous testing
|
||||||
|
|
||||||
uncompyle6 2.13.3 2017-11-13
|
uncompyle6 2.13.3 2017-11-13
|
||||||
|
|
||||||
@@ -101,7 +194,7 @@ Overall: better 3.6 decompiling and some much needed code refactoring and cleanu
|
|||||||
added to assist here. Ignoring errors may be okay because the fragment parser often just needs,
|
added to assist here. Ignoring errors may be okay because the fragment parser often just needs,
|
||||||
well, *fragments*.
|
well, *fragments*.
|
||||||
- Distinguish RETURN_VALUE from RETURN_END_IF in exception bodies better in 3.6
|
- Distinguish RETURN_VALUE from RETURN_END_IF in exception bodies better in 3.6
|
||||||
- bug in 3.x language changes: import queue va import Queue
|
- bug in 3.x language changes: import queue via import Queue
|
||||||
- reinstate some bytecode tests since decompiling has gotten better
|
- reinstate some bytecode tests since decompiling has gotten better
|
||||||
- Revise how to report a bug
|
- Revise how to report a bug
|
||||||
|
|
||||||
@@ -136,8 +229,8 @@ uncompyle6 2.11.4 2017-08-15
|
|||||||
|
|
||||||
* scanner and parser now allow 3-part version string lookups,
|
* scanner and parser now allow 3-part version string lookups,
|
||||||
e.g. 2.7.1 We allow a float here, but if passed a string like '2.7'. or
|
e.g. 2.7.1 We allow a float here, but if passed a string like '2.7'. or
|
||||||
* unpin 3.5.1. xdis 3.5.4 has been releasd and fixes the problems we had. Use that.
|
* unpin 3.5.1. xdis 3.5.4 has been release and fixes the problems we had. Use that.
|
||||||
* some routnes here moved to xdis. Use the xdis version
|
* some routines here moved to xdis. Use the xdis version
|
||||||
* README.rst: Link typo Name is trepan2 now not trepan
|
* README.rst: Link typo Name is trepan2 now not trepan
|
||||||
* xdis-forced change adjust for COMPARE_OP "is-not" in
|
* xdis-forced change adjust for COMPARE_OP "is-not" in
|
||||||
semanatic routines. We need "is not".
|
semanatic routines. We need "is not".
|
||||||
@@ -233,9 +326,9 @@ uncompyle6 2.9.8 2016-12-16
|
|||||||
- fix bug in --verify option
|
- fix bug in --verify option
|
||||||
- DRY (a little) control-flow detection
|
- DRY (a little) control-flow detection
|
||||||
- fix syntax in tuples with one element
|
- fix syntax in tuples with one element
|
||||||
- if AST rule inheritence in Python 2.5
|
- if AST rule inheritance in Python 2.5
|
||||||
- NAME_MODULE removal for Python <= 2.4
|
- NAME_MODULE removal for Python <= 2.4
|
||||||
- verifycall fixes for Python <= 2.4
|
- verify call fixes for Python <= 2.4
|
||||||
- more Python lint
|
- more Python lint
|
||||||
|
|
||||||
uncompyle6 2.9.7 2016-12-16
|
uncompyle6 2.9.7 2016-12-16
|
||||||
@@ -271,7 +364,7 @@ uncompyle6 2.9.6 2016-11-20
|
|||||||
in the results.
|
in the results.
|
||||||
- better control flow debugging output
|
- better control flow debugging output
|
||||||
- Python 2 and 3 detect structure code is more similar
|
- Python 2 and 3 detect structure code is more similar
|
||||||
- Handle Docstrings with embedded tiple quotes (""")
|
- Handle Docstrings with embedded triple quotes (""")
|
||||||
|
|
||||||
uncompyle6 2.9.5 2016-11-13
|
uncompyle6 2.9.5 2016-11-13
|
||||||
|
|
||||||
|
100
README.rst
100
README.rst
@@ -1,4 +1,4 @@
|
|||||||
|buildstatus|
|
|buildstatus| |Latest Version| |Supported Python Versions|
|
||||||
|
|
||||||
uncompyle6
|
uncompyle6
|
||||||
==========
|
==========
|
||||||
@@ -11,8 +11,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.5, and 2.1 to
|
source code. It accepts bytecodes from Python version 1.3 to version
|
||||||
3.7 or so, including PyPy bytecode and Dropbox's Python 2.5 bytecode.
|
3.7, spanning over 22 years of Python releases. We include Dropbox's
|
||||||
|
Python 2.5 bytecode and some PyPy bytecode.
|
||||||
|
|
||||||
Why this?
|
Why this?
|
||||||
---------
|
---------
|
||||||
@@ -29,11 +30,11 @@ CPython bytecode decompilers is the ability to deparse just
|
|||||||
*fragments* of source code and give source-code information around a
|
*fragments* of source code and give source-code information around a
|
||||||
given bytecode offset.
|
given bytecode offset.
|
||||||
|
|
||||||
I use the tree fragments to deparse fragments of code inside my
|
I use the tree fragments to deparse fragments of code *at run time*
|
||||||
trepan_ debuggers_. For that, bytecode offsets are recorded and
|
inside my trepan_ debuggers_. For that, bytecode offsets are recorded
|
||||||
associated with fragments of the source code. This purpose, although
|
and associated with fragments of the source code. This purpose,
|
||||||
compatible with the original intention, is yet a little bit different.
|
although compatible with the original intention, is yet a little bit
|
||||||
See this_ for more information.
|
different. See this_ for more information.
|
||||||
|
|
||||||
Python fragment deparsing given an instruction offset is useful in
|
Python fragment deparsing given an instruction offset is useful in
|
||||||
showing stack traces and can be encorporated into any program that
|
showing stack traces and can be encorporated into any program that
|
||||||
@@ -52,8 +53,17 @@ You get the idea. This code pulls all of these forks together and
|
|||||||
*moves forward*. There is some serious refactoring and cleanup in this
|
*moves forward*. There is some serious refactoring and cleanup in this
|
||||||
code base over those old forks.
|
code base over those old forks.
|
||||||
|
|
||||||
This project has the most complete support for Python 3.3 and above
|
This demonstrably does the best in decompiling Python across all
|
||||||
and the best all-around Python support.
|
Python versions. And even when there is another project that only
|
||||||
|
provides decompilation for subset of Python versions, we generally do
|
||||||
|
demonstrably better for those as well.
|
||||||
|
|
||||||
|
How can we tell? By taking Python bytecode that comes distributed with
|
||||||
|
that version of Python and decompiling these. Among those that
|
||||||
|
successfully decompile, we can then make sure the resulting programs
|
||||||
|
are syntactically correct by running the Python interpreter for that
|
||||||
|
bytecode version. Finally, in cases where the program has a test for
|
||||||
|
itself, we can run the check on the decompiled code.
|
||||||
|
|
||||||
We are serious about testing, and use automated processes to find
|
We are serious about testing, and use automated processes to find
|
||||||
bugs. In the issue trackers for other decompilers, you will find a
|
bugs. In the issue trackers for other decompilers, you will find a
|
||||||
@@ -66,7 +76,7 @@ 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
|
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-2.4 branch. The bytecode files it can read have been tested on
|
||||||
Python bytecodes from versions 1.5, 2.1-2.7, and 3.0-3.6 and the
|
Python bytecodes from versions 1.4, 2.1-2.7, and 3.0-3.6 and the
|
||||||
above-mentioned PyPy versions.
|
above-mentioned PyPy versions.
|
||||||
|
|
||||||
Installation
|
Installation
|
||||||
@@ -136,26 +146,26 @@ All of the Python decompilers that I have looked at have problems
|
|||||||
decompiling Python's control flow. In some cases we can detect an
|
decompiling Python's control flow. In some cases we can detect an
|
||||||
erroneous decompilation and report that.
|
erroneous decompilation and report that.
|
||||||
|
|
||||||
*Verification* is the process of decompiling bytecode, compiling with
|
In older versions of Python it was possible to verify bytecode by
|
||||||
a Python for that bytecode version, and then comparing the bytecode
|
decompiling bytecode, and then compiling using the Python interpreter
|
||||||
produced by the decompiled/compiled program. Some allowance is made
|
for that bytecode version. Having done this the bytecode produced
|
||||||
for inessential differences. But other semantically equivalent
|
could be compared with the original bytecode. However as Python's code
|
||||||
differences are not caught. For example ``1 and 0`` is decompiled to
|
generation got better, this is no longer feasible.
|
||||||
the equivalent ``0``; remnants of the first true evaluation (1) is
|
|
||||||
lost when Python compiles this. When Python next compiles ``0`` the
|
|
||||||
resulting code is simpler.
|
|
||||||
|
|
||||||
*Weak Verification*
|
There verification that we use that doesn't check bytecode for
|
||||||
on the other hand doesn't check bytecode for equivalence but does
|
equivalence but does check to see if the resulting decompiled source
|
||||||
check to see if the resulting decompiled source is a valid Python
|
is a valid Python program by running the Python interpreter. Because
|
||||||
program by running the Python interpreter. Because the Python language
|
the Python language has changed so much, for best results you should
|
||||||
has changed so much, for best results you should use the same Python
|
use the same Python version in checking as was used in creating the
|
||||||
Version in checking as used in the bytecode.
|
bytecode.
|
||||||
|
|
||||||
Finally, we have automated running the standard Python tests after
|
There are however an interesting class of these programs that is
|
||||||
first compiling and decompiling the test program. Results here are a
|
readily available give stronger verification: those programs that
|
||||||
bit weak (if not better than most other Python decompilers). But over
|
when run check some computation, or even better themselves.
|
||||||
time this will probably get better.
|
|
||||||
|
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
|
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
|
get further away from that. Support is also probably pretty good for
|
||||||
@@ -165,19 +175,21 @@ that era was minimal)
|
|||||||
|
|
||||||
There is some work to do on the lower end Python versions which is
|
There is some work to do on the lower end Python versions which is
|
||||||
more difficult for us to handle since we don't have a Python
|
more difficult for us to handle since we don't have a Python
|
||||||
interpreter for versions 1.5, 1.6, and 2.0.
|
interpreter for versions 1.6, and 2.0.
|
||||||
|
|
||||||
In the Python 3 series, Python support is is strongest around 3.4 or
|
In the Python 3 series, Python support is is strongest around 3.4 or
|
||||||
3.3 and drops off as you move further away from those versions. Python
|
3.3 and drops off as you move further away from those versions. Python
|
||||||
3.6 changes things drastically by using word codes rather than byte
|
3.0 is weird in that it in some ways resembles 2.6 more than it does
|
||||||
codes. As a result, the jump offset field in a jump instruction
|
3.1 or 2.7. Python 3.6 changes things drastically by using word codes
|
||||||
argument has been reduced. This makes the `EXTENDED_ARG` instructions
|
rather than byte codes. As a result, the jump offset field in a jump
|
||||||
are now more prevalent in jump instruction; previously they had been
|
instruction argument has been reduced. This makes the `EXTENDED_ARG`
|
||||||
rare. Perhaps to compensate for the additional `EXTENDED_ARG`
|
instructions are now more prevalent in jump instruction; previously
|
||||||
instructions, additional jump optimization has been added. So in sum
|
they had been rare. Perhaps to compensate for the additional
|
||||||
handling control flow by ad hoc means as is currently done is worse.
|
`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.
|
||||||
|
|
||||||
Also, between Python 3.5, 3.6 and 3.7 there have been major changes to the
|
Between Python 3.5, 3.6 and 3.7 there have been major changes to the
|
||||||
`MAKE_FUNCTION` and `CALL_FUNCTION` instructions.
|
`MAKE_FUNCTION` and `CALL_FUNCTION` instructions.
|
||||||
|
|
||||||
Currently not all Python magic numbers are supported. Specifically in
|
Currently not all Python magic numbers are supported. Specifically in
|
||||||
@@ -203,11 +215,12 @@ There is lots to do, so please dig in and help.
|
|||||||
See Also
|
See Also
|
||||||
--------
|
--------
|
||||||
|
|
||||||
* https://github.com/zrax/pycdc : supports all versions of Python and is written in C++. Support for later Python 3 versions is a bit lacking though.
|
* https://github.com/zrax/pycdc : 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://code.google.com/archive/p/unpyc3/ : supports Python 3.2 only. The above projects use a different decompiling technique than what is used here.
|
* https://code.google.com/archive/p/unpyc3/ : supports Python 3.2 only. The above projects use a different decompiling technique than what is used here. Currently unmaintained.
|
||||||
* https://github.com/figment/unpyc3/ : fork of above, but supports Python 3.3 only. Includes some fixes like supporting function annotations
|
* https://github.com/figment/unpyc3/ : fork of above, but supports Python 3.3 only. Includes some fixes like supporting function annotations. Currently unmaintained.
|
||||||
* The HISTORY_ file.
|
* 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
|
||||||
* `How to report a bug <https://github.com/rocky/python-uncompyle6/blob/master/HOW-TO-REPORT-A-BUG.md>`_
|
* `How to report a bug <https://github.com/rocky/python-uncompyle6/blob/master/HOW-TO-REPORT-A-BUG.md>`_
|
||||||
|
* The HISTORY_ file.
|
||||||
* 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
|
||||||
@@ -225,3 +238,6 @@ See Also
|
|||||||
.. _PJOrion: http://www.koreanrandom.com/forum/topic/15280-pjorion-%D1%80%D0%B5%D0%B4%D0%B0%D0%BA%D1%82%D0%B8%D1%80%D0%BE%D0%B2%D0%B0%D0%BD%D0%B8%D0%B5-%D0%BA%D0%BE%D0%BC%D0%BF%D0%B8%D0%BB%D1%8F%D1%86%D0%B8%D1%8F-%D0%B4%D0%B5%D0%BA%D0%BE%D0%BC%D0%BF%D0%B8%D0%BB%D1%8F%D1%86%D0%B8%D1%8F-%D0%BE%D0%B1%D1%84
|
.. _PJOrion: http://www.koreanrandom.com/forum/topic/15280-pjorion-%D1%80%D0%B5%D0%B4%D0%B0%D0%BA%D1%82%D0%B8%D1%80%D0%BE%D0%B2%D0%B0%D0%BD%D0%B8%D0%B5-%D0%BA%D0%BE%D0%BC%D0%BF%D0%B8%D0%BB%D1%8F%D1%86%D0%B8%D1%8F-%D0%B4%D0%B5%D0%BA%D0%BE%D0%BC%D0%BF%D0%B8%D0%BB%D1%8F%D1%86%D0%B8%D1%8F-%D0%BE%D0%B1%D1%84
|
||||||
.. _Deobfuscator: https://github.com/extremecoders-re/PjOrion-Deobfuscator
|
.. _Deobfuscator: https://github.com/extremecoders-re/PjOrion-Deobfuscator
|
||||||
.. _Py2EXE: https://en.wikipedia.org/wiki/Py2exe
|
.. _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
|
||||||
|
@@ -1,3 +1,17 @@
|
|||||||
|
# Copyright (C) 2018 Rocky Bernstein <rocky@gnu.org>
|
||||||
|
#
|
||||||
|
# This program is free software: you can redistribute it and/or modify
|
||||||
|
# it under the terms of the GNU General Public License as published by
|
||||||
|
# the Free Software Foundation, either version 3 of the License, or
|
||||||
|
# (at your option) any later version.
|
||||||
|
#
|
||||||
|
# This program is distributed in the hope that it will be useful,
|
||||||
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
# GNU General Public License for more details.
|
||||||
|
#
|
||||||
|
# You should have received a copy of the GNU General Public License
|
||||||
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
"""uncompyle6 packaging information"""
|
"""uncompyle6 packaging information"""
|
||||||
|
|
||||||
# To the extent possible we make this file look more like a
|
# To the extent possible we make this file look more like a
|
||||||
@@ -14,12 +28,14 @@ Copyright (C) 2015-2018 Rocky Bernstein <rb@dustyfeet.com>.
|
|||||||
|
|
||||||
classifiers = ['Development Status :: 5 - Production/Stable',
|
classifiers = ['Development Status :: 5 - Production/Stable',
|
||||||
'Intended Audience :: Developers',
|
'Intended Audience :: Developers',
|
||||||
|
'License :: OSI Approved :: GNU General Public License v3 (GPLv3)',
|
||||||
'Operating System :: OS Independent',
|
'Operating System :: OS Independent',
|
||||||
'Programming Language :: Python',
|
'Programming Language :: Python',
|
||||||
'Programming Language :: Python :: 2.4',
|
'Programming Language :: Python :: 2.4',
|
||||||
'Programming Language :: Python :: 2.5',
|
'Programming Language :: Python :: 2.5',
|
||||||
'Programming Language :: Python :: 2.6',
|
'Programming Language :: Python :: 2.6',
|
||||||
'Programming Language :: Python :: 2.7',
|
'Programming Language :: Python :: 2.7',
|
||||||
|
'Programming Language :: Python :: 3.0',
|
||||||
'Programming Language :: Python :: 3.1',
|
'Programming Language :: Python :: 3.1',
|
||||||
'Programming Language :: Python :: 3.2',
|
'Programming Language :: Python :: 3.2',
|
||||||
'Programming Language :: Python :: 3.3',
|
'Programming Language :: Python :: 3.3',
|
||||||
@@ -40,10 +56,10 @@ entry_points = {
|
|||||||
'pydisassemble=uncompyle6.bin.pydisassemble:main',
|
'pydisassemble=uncompyle6.bin.pydisassemble:main',
|
||||||
]}
|
]}
|
||||||
ftp_url = None
|
ftp_url = None
|
||||||
install_requires = ['spark-parser >= 1.8.5, < 1.9.0',
|
install_requires = ['spark-parser >= 1.8.7, < 1.9.0',
|
||||||
'xdis >= 3.6.9, < 3.7.0', 'six']
|
'xdis >= 3.8.8, < 3.9.0']
|
||||||
|
|
||||||
license = 'MIT'
|
license = 'GPL3'
|
||||||
mailing_list = 'python-debugger@googlegroups.com'
|
mailing_list = 'python-debugger@googlegroups.com'
|
||||||
modname = 'uncompyle6'
|
modname = 'uncompyle6'
|
||||||
py_modules = None
|
py_modules = None
|
||||||
|
@@ -16,6 +16,7 @@ if ! source ./setup-master.sh ; then
|
|||||||
fi
|
fi
|
||||||
cd ..
|
cd ..
|
||||||
for version in $PYVERSIONS; do
|
for version in $PYVERSIONS; do
|
||||||
|
echo --- $version ---
|
||||||
if ! pyenv local $version ; then
|
if ! pyenv local $version ; then
|
||||||
exit $?
|
exit $?
|
||||||
fi
|
fi
|
||||||
@@ -23,4 +24,5 @@ for version in $PYVERSIONS; do
|
|||||||
if ! make check; then
|
if ! make check; then
|
||||||
exit $?
|
exit $?
|
||||||
fi
|
fi
|
||||||
|
echo === $version ===
|
||||||
done
|
done
|
||||||
|
@@ -15,6 +15,7 @@ fi
|
|||||||
|
|
||||||
cd ..
|
cd ..
|
||||||
for version in $PYVERSIONS; do
|
for version in $PYVERSIONS; do
|
||||||
|
echo --- $version ---
|
||||||
if ! pyenv local $version ; then
|
if ! pyenv local $version ; then
|
||||||
exit $?
|
exit $?
|
||||||
fi
|
fi
|
||||||
@@ -22,4 +23,5 @@ for version in $PYVERSIONS; do
|
|||||||
if ! make check ; then
|
if ! make check ; then
|
||||||
exit $?
|
exit $?
|
||||||
fi
|
fi
|
||||||
|
echo === $version ===
|
||||||
done
|
done
|
||||||
|
15
admin-tools/pycdc-runtests.sh
Executable file
15
admin-tools/pycdc-runtests.sh
Executable file
@@ -0,0 +1,15 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
# Use pycdc to run our test/bytecode* test suite
|
||||||
|
bs=${BASH_SOURCE[0]}
|
||||||
|
testdir=$(dirname $bs)/../test
|
||||||
|
fulldir=$(readlink -f $testdir)
|
||||||
|
cd $fulldir
|
||||||
|
for dir in bytecode_* ; do
|
||||||
|
echo ========= $dir ================
|
||||||
|
cd $fulldir/$dir
|
||||||
|
for file in *.pyc; do
|
||||||
|
if ! pycdc $file > /dev/null ; then
|
||||||
|
echo ----- $dir/$file ------
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
done
|
@@ -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.5.3 3.6.3 2.6.9 3.3.6 2.7.14 3.4.2'
|
export PYVERSIONS='3.5.5 3.6.6 3.7.1 2.6.9 3.3.7 2.7.15 3.2.6 3.1.5 3.4.8'
|
||||||
|
28
admin-tools/run-pyenvlib-test-all.sh
Executable file
28
admin-tools/run-pyenvlib-test-all.sh
Executable file
@@ -0,0 +1,28 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
# Runs test_pyenvlib.test on all versions of Python master.
|
||||||
|
function finish {
|
||||||
|
cd $owd
|
||||||
|
}
|
||||||
|
|
||||||
|
# FIXME put some of the below in a common routine
|
||||||
|
owd=$(pwd)
|
||||||
|
trap finish EXIT
|
||||||
|
|
||||||
|
cd $(dirname ${BASH_SOURCE[0]})
|
||||||
|
if ! source ./pyenv-newer-versions ; then
|
||||||
|
exit $?
|
||||||
|
fi
|
||||||
|
if ! source ./setup-master.sh ; then
|
||||||
|
exit $?
|
||||||
|
fi
|
||||||
|
cd ../test
|
||||||
|
for version in $PYVERSIONS; do
|
||||||
|
if ! pyenv local $version ; then
|
||||||
|
exit $?
|
||||||
|
fi
|
||||||
|
echo "====== Running test_pyenvlib.py on $version ====="
|
||||||
|
if ! python ./test_pyenvlib.py --weak-verify --max 800 --${version} ; then
|
||||||
|
exit $?
|
||||||
|
fi
|
||||||
|
echo "------ Done test_pyenvlib.py on $version -----"
|
||||||
|
done
|
@@ -1,5 +1,5 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
PYTHON_VERSION=3.6.3
|
PYTHON_VERSION=3.6.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 {
|
||||||
|
32
admin-tools/uncompyle2-runtests.sh
Executable file
32
admin-tools/uncompyle2-runtests.sh
Executable file
@@ -0,0 +1,32 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
# Use pycdc to run our test/bytecode_2.7* test suite
|
||||||
|
bs=${BASH_SOURCE[0]}
|
||||||
|
topdir=$(dirname $bs)/..
|
||||||
|
(cd $topdir && pyenv local 2.7.14)
|
||||||
|
testdir=$topdir/test
|
||||||
|
fulldir=$(readlink -f $testdir)
|
||||||
|
cd $fulldir
|
||||||
|
|
||||||
|
for bytecode in bytecode_2.7/*.pyc ; do
|
||||||
|
echo $bytecode
|
||||||
|
uncompyle2 $bytecode > /dev/null
|
||||||
|
echo ================ $bytecode rc: $? ==============
|
||||||
|
done
|
||||||
|
|
||||||
|
tmpdir=/tmp/test-2.7
|
||||||
|
( cd bytecode_2.7_run &&
|
||||||
|
mkdir $tmpdir || true
|
||||||
|
for bytecode in *.pyc ; do
|
||||||
|
shortname=$(basename $bytecode .pyc)
|
||||||
|
echo $bytecode
|
||||||
|
py_file=${tmpdir}/${shortname}.py
|
||||||
|
typeset -i rc=0
|
||||||
|
uncompyle2 $bytecode > $py_file
|
||||||
|
rc=$?
|
||||||
|
if (( rc == 0 )); then
|
||||||
|
python $py_file
|
||||||
|
rc=$?
|
||||||
|
fi
|
||||||
|
echo ================ $bytecode rc: $rc ==============
|
||||||
|
done
|
||||||
|
)
|
@@ -47,7 +47,7 @@ install:
|
|||||||
|
|
||||||
# Upgrade to the latest version of pip to avoid it displaying warnings
|
# Upgrade to the latest version of pip to avoid it displaying warnings
|
||||||
# about it being out of date.
|
# about it being out of date.
|
||||||
- "pip install --disable-pip-version-check --user --upgrade pip"
|
- "%PYTHON%\\python.exe -m pip install --disable-pip-version-check --user --upgrade pip"
|
||||||
|
|
||||||
# Install the build dependencies of the project. If some dependencies contain
|
# Install the build dependencies of the project. If some dependencies contain
|
||||||
# compiled extensions and are not provided as pre-built wheel packages,
|
# compiled extensions and are not provided as pre-built wheel packages,
|
||||||
|
14
circle.yml
14
circle.yml
@@ -1,14 +0,0 @@
|
|||||||
machine:
|
|
||||||
python:
|
|
||||||
version: 2.7.10
|
|
||||||
environment:
|
|
||||||
COMPILE: --compile
|
|
||||||
|
|
||||||
dependencies:
|
|
||||||
override:
|
|
||||||
- pip install -e .
|
|
||||||
- pip install pytest==3.2.5 hypothesis
|
|
||||||
test:
|
|
||||||
override:
|
|
||||||
- python ./setup.py develop && make check-2.7
|
|
||||||
- cd ./test/stdlib && pyenv local 2.7.10 && bash ./runtests.sh 'test_[p-z]*.py'
|
|
@@ -1,5 +1,5 @@
|
|||||||
import pytest
|
import pytest
|
||||||
from uncompyle6.semantics.fragments import deparse_code as deparse, deparsed_find
|
from uncompyle6.semantics.fragments import code_deparse as deparse, deparsed_find
|
||||||
from uncompyle6 import PYTHON_VERSION, PYTHON3
|
from uncompyle6 import PYTHON_VERSION, PYTHON3
|
||||||
|
|
||||||
def map_stmts(x, y):
|
def map_stmts(x, y):
|
||||||
@@ -31,12 +31,13 @@ def list_comp():
|
|||||||
|
|
||||||
def get_parsed_for_fn(fn):
|
def get_parsed_for_fn(fn):
|
||||||
code = fn.__code__ if PYTHON3 else fn.func_code
|
code = fn.__code__ if PYTHON3 else fn.func_code
|
||||||
return deparse(PYTHON_VERSION, code)
|
return deparse(code, version=PYTHON_VERSION)
|
||||||
|
|
||||||
def check_expect(expect, parsed, fn_name):
|
def check_expect(expect, parsed, fn_name):
|
||||||
debug = False
|
debug = False
|
||||||
i = 2
|
i = 2
|
||||||
max_expect = len(expect)
|
max_expect = len(expect)
|
||||||
|
code = get_parsed_for_fn(fn_name)
|
||||||
for name, offset in sorted(parsed.offsets.keys()):
|
for name, offset in sorted(parsed.offsets.keys()):
|
||||||
assert i+1 <= max_expect, (
|
assert i+1 <= max_expect, (
|
||||||
"%s: ran out if items in testing node" % fn_name)
|
"%s: ran out if items in testing node" % fn_name)
|
||||||
|
@@ -1,8 +1,6 @@
|
|||||||
#!/usr/bin/env python
|
#!/usr/bin/env python
|
||||||
from uncompyle6 import PYTHON_VERSION, IS_PYPY
|
from uncompyle6 import PYTHON_VERSION, IS_PYPY
|
||||||
from uncompyle6.scanner import get_scanner
|
from uncompyle6.scanner import get_scanner
|
||||||
from xdis.bytecode import Bytecode
|
|
||||||
from array import array
|
|
||||||
def bug(state, slotstate):
|
def bug(state, slotstate):
|
||||||
if state:
|
if state:
|
||||||
if slotstate is not None:
|
if slotstate is not None:
|
||||||
@@ -24,16 +22,8 @@ def bug_loop(disassemble, tb=None):
|
|||||||
def test_if_in_for():
|
def test_if_in_for():
|
||||||
code = bug.__code__
|
code = bug.__code__
|
||||||
scan = get_scanner(PYTHON_VERSION)
|
scan = get_scanner(PYTHON_VERSION)
|
||||||
print(PYTHON_VERSION)
|
|
||||||
if 2.7 <= PYTHON_VERSION <= 3.0 and not IS_PYPY:
|
if 2.7 <= PYTHON_VERSION <= 3.0 and not IS_PYPY:
|
||||||
n = scan.setup_code(code)
|
scan.build_instructions(code)
|
||||||
bytecode = Bytecode(code, scan.opc)
|
|
||||||
scan.build_lines_data(code, n)
|
|
||||||
scan.insts = list(bytecode)
|
|
||||||
scan.offset2inst_index = {}
|
|
||||||
for i, inst in enumerate(scan.insts):
|
|
||||||
scan.offset2inst_index[inst.offset] = i
|
|
||||||
scan.build_prev_op(n)
|
|
||||||
fjt = scan.find_jump_targets(False)
|
fjt = scan.find_jump_targets(False)
|
||||||
|
|
||||||
## FIXME: the data below is wrong.
|
## FIXME: the data below is wrong.
|
||||||
@@ -48,14 +38,7 @@ def test_if_in_for():
|
|||||||
# {'start': 62, 'end': 63, 'type': 'for-else'}]
|
# {'start': 62, 'end': 63, 'type': 'for-else'}]
|
||||||
|
|
||||||
code = bug_loop.__code__
|
code = bug_loop.__code__
|
||||||
n = scan.setup_code(code)
|
scan.build_instructions(code)
|
||||||
bytecode = Bytecode(code, scan.opc)
|
|
||||||
scan.build_lines_data(code, n)
|
|
||||||
scan.insts = list(bytecode)
|
|
||||||
scan.build_prev_op(n)
|
|
||||||
scan.offset2inst_index = {}
|
|
||||||
for i, inst in enumerate(scan.insts):
|
|
||||||
scan.offset2inst_index[inst.offset] = i
|
|
||||||
fjt = scan.find_jump_targets(False)
|
fjt = scan.find_jump_targets(False)
|
||||||
assert{64: [42], 67: [42, 42], 42: [16, 41], 19: [6]} == fjt
|
assert{64: [42], 67: [42, 42], 42: [16, 41], 19: [6]} == fjt
|
||||||
assert scan.structs == [
|
assert scan.structs == [
|
||||||
@@ -69,14 +52,7 @@ def test_if_in_for():
|
|||||||
{'start': 48, 'end': 67, 'type': 'while-loop'}]
|
{'start': 48, 'end': 67, 'type': 'while-loop'}]
|
||||||
|
|
||||||
elif 3.2 < PYTHON_VERSION <= 3.4:
|
elif 3.2 < PYTHON_VERSION <= 3.4:
|
||||||
bytecode = Bytecode(code, scan.opc)
|
scan.build_instructions(code)
|
||||||
scan.code = array('B', code.co_code)
|
|
||||||
scan.build_lines_data(code)
|
|
||||||
scan.build_prev_op()
|
|
||||||
scan.insts = list(bytecode)
|
|
||||||
scan.offset2inst_index = {}
|
|
||||||
for i, inst in enumerate(scan.insts):
|
|
||||||
scan.offset2inst_index[inst.offset] = i
|
|
||||||
fjt = scan.find_jump_targets(False)
|
fjt = scan.find_jump_targets(False)
|
||||||
assert {69: [66], 63: [18]} == fjt
|
assert {69: [66], 63: [18]} == fjt
|
||||||
assert scan.structs == \
|
assert scan.structs == \
|
||||||
@@ -86,5 +62,6 @@ def test_if_in_for():
|
|||||||
{'end': 59, 'type': 'for-loop', 'start': 31},
|
{'end': 59, 'type': 'for-loop', 'start': 31},
|
||||||
{'end': 63, 'type': 'for-else', 'start': 62}]
|
{'end': 63, 'type': 'for-else', 'start': 62}]
|
||||||
else:
|
else:
|
||||||
assert True, "FIXME: should note fixed"
|
print("FIXME: should fix for %s" % PYTHON_VERSION)
|
||||||
|
assert True
|
||||||
return
|
return
|
||||||
|
@@ -1,150 +1,154 @@
|
|||||||
# std
|
# std
|
||||||
import os
|
|
||||||
# test
|
# test
|
||||||
import pytest
|
|
||||||
import hypothesis
|
|
||||||
from hypothesis import strategies as st
|
|
||||||
# uncompyle6
|
|
||||||
from uncompyle6 import PYTHON_VERSION, deparse_code
|
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
|
@st.composite
|
||||||
def expressions(draw):
|
def expressions(draw):
|
||||||
# todo : would be nice to generate expressions using hypothesis however
|
# todo : would be nice to generate expressions using hypothesis however
|
||||||
# this is pretty involved so for now just use a corpus of expressions
|
# this is pretty involved so for now just use a corpus of expressions
|
||||||
# from which to select.
|
# from which to select.
|
||||||
return draw(st.sampled_from((
|
return draw(st.sampled_from((
|
||||||
'abc',
|
'abc',
|
||||||
'len(items)',
|
'len(items)',
|
||||||
'x + 1',
|
'x + 1',
|
||||||
'lineno',
|
'lineno',
|
||||||
'container',
|
'container',
|
||||||
'self.attribute',
|
'self.attribute',
|
||||||
'self.method()',
|
'self.method()',
|
||||||
# These expressions are failing, I think these are control
|
# These expressions are failing, I think these are control
|
||||||
# flow problems rather than problems with FORMAT_VALUE,
|
# flow problems rather than problems with FORMAT_VALUE,
|
||||||
# however I need to confirm this...
|
# however I need to confirm this...
|
||||||
#'sorted(items, key=lambda x: x.name)',
|
#'sorted(items, key=lambda x: x.name)',
|
||||||
#'func(*args, **kwargs)',
|
#'func(*args, **kwargs)',
|
||||||
#'text or default',
|
#'text or default',
|
||||||
#'43 if life_the_universe and everything else None'
|
#'43 if life_the_universe and everything else None'
|
||||||
)))
|
)))
|
||||||
|
|
||||||
|
|
||||||
@st.composite
|
@st.composite
|
||||||
def format_specifiers(draw):
|
def format_specifiers(draw):
|
||||||
"""
|
"""
|
||||||
Generate a valid format specifier using the rules:
|
Generate a valid format specifier using the rules:
|
||||||
|
|
||||||
format_spec ::= [[fill]align][sign][#][0][width][,][.precision][type]
|
format_spec ::= [[fill]align][sign][#][0][width][,][.precision][type]
|
||||||
fill ::= <any character>
|
fill ::= <any character>
|
||||||
align ::= "<" | ">" | "=" | "^"
|
align ::= "<" | ">" | "=" | "^"
|
||||||
sign ::= "+" | "-" | " "
|
sign ::= "+" | "-" | " "
|
||||||
width ::= integer
|
width ::= integer
|
||||||
precision ::= integer
|
precision ::= integer
|
||||||
type ::= "b" | "c" | "d" | "e" | "E" | "f" | "F" | "g" | "G" | "n" | "o" | "s" | "x" | "X" | "%"
|
type ::= "b" | "c" | "d" | "e" | "E" | "f" | "F" | "g" | "G" | "n" | "o" | "s" | "x" | "X" | "%"
|
||||||
|
|
||||||
See https://docs.python.org/2/library/string.html
|
See https://docs.python.org/2/library/string.html
|
||||||
|
|
||||||
:param draw: Let hypothesis draw from other strategies.
|
:param draw: Let hypothesis draw from other strategies.
|
||||||
|
|
||||||
:return: An example format_specifier.
|
:return: An example format_specifier.
|
||||||
"""
|
"""
|
||||||
alphabet_strategy = st.characters(min_codepoint=ord('a'), max_codepoint=ord('z'))
|
alphabet_strategy = st.characters(min_codepoint=ord('a'), max_codepoint=ord('z'))
|
||||||
fill = draw(st.one_of(alphabet_strategy, st.none()))
|
fill = draw(st.one_of(alphabet_strategy, st.none()))
|
||||||
align = draw(st.sampled_from(list('<>=^')))
|
align = draw(st.sampled_from(list('<>=^')))
|
||||||
fill_align = (fill + align or '') if fill else ''
|
fill_align = (fill + align or '') if fill else ''
|
||||||
|
|
||||||
type_ = draw(st.sampled_from('bcdeEfFgGnosxX%'))
|
type_ = draw(st.sampled_from('bcdeEfFgGnosxX%'))
|
||||||
can_have_sign = type_ in 'deEfFgGnoxX%'
|
can_have_sign = type_ in 'deEfFgGnoxX%'
|
||||||
can_have_comma = type_ in 'deEfFgG%'
|
can_have_comma = type_ in 'deEfFgG%'
|
||||||
can_have_precision = type_ in 'fFgG'
|
can_have_precision = type_ in 'fFgG'
|
||||||
can_have_pound = type_ in 'boxX%'
|
can_have_pound = type_ in 'boxX%'
|
||||||
can_have_zero = type_ in 'oxX'
|
can_have_zero = type_ in 'oxX'
|
||||||
|
|
||||||
sign = draw(st.sampled_from(list('+- ') + [''])) if can_have_sign else ''
|
sign = draw(st.sampled_from(list('+- ') + [''])) if can_have_sign else ''
|
||||||
pound = draw(st.sampled_from(('#', '',))) if can_have_pound else ''
|
pound = draw(st.sampled_from(('#', '',))) if can_have_pound else ''
|
||||||
zero = draw(st.sampled_from(('0', '',))) if can_have_zero else ''
|
zero = draw(st.sampled_from(('0', '',))) if can_have_zero else ''
|
||||||
|
|
||||||
int_strategy = st.integers(min_value=1, max_value=1000)
|
int_strategy = st.integers(min_value=1, max_value=1000)
|
||||||
|
|
||||||
width = draw(st.one_of(int_strategy, st.none()))
|
width = draw(st.one_of(int_strategy, st.none()))
|
||||||
width = str(width) if width is not None else ''
|
width = str(width) if width is not None else ''
|
||||||
|
|
||||||
comma = draw(st.sampled_from((',', '',))) if can_have_comma else ''
|
comma = draw(st.sampled_from((',', '',))) if can_have_comma else ''
|
||||||
if can_have_precision:
|
if can_have_precision:
|
||||||
precision = draw(st.one_of(int_strategy, st.none()))
|
precision = draw(st.one_of(int_strategy, st.none()))
|
||||||
precision = '.' + str(precision) if precision else ''
|
precision = '.' + str(precision) if precision else ''
|
||||||
else:
|
else:
|
||||||
precision = ''
|
precision = ''
|
||||||
|
|
||||||
return ''.join((fill_align, sign, pound, zero, width, comma, precision, type_,))
|
return ''.join((fill_align, sign, pound, zero, width, comma, precision, type_,))
|
||||||
|
|
||||||
|
|
||||||
@st.composite
|
@st.composite
|
||||||
def fstrings(draw):
|
def fstrings(draw):
|
||||||
"""
|
"""
|
||||||
Generate a valid f-string.
|
Generate a valid f-string.
|
||||||
See https://www.python.org/dev/peps/pep-0498/#specification
|
See https://www.python.org/dev/peps/pep-0498/#specification
|
||||||
|
|
||||||
:param draw: Let hypothsis draw from other strategies.
|
:param draw: Let hypothsis draw from other strategies.
|
||||||
|
|
||||||
:return: A valid f-string.
|
:return: A valid f-string.
|
||||||
"""
|
"""
|
||||||
character_strategy = st.characters(
|
character_strategy = st.characters(
|
||||||
blacklist_characters='\r\n\'\\s{}',
|
blacklist_characters='\r\n\'\\s{}',
|
||||||
min_codepoint=1,
|
min_codepoint=1,
|
||||||
max_codepoint=1000,
|
max_codepoint=1000,
|
||||||
)
|
)
|
||||||
is_raw = draw(st.booleans())
|
is_raw = draw(st.booleans())
|
||||||
integer_strategy = st.integers(min_value=0, max_value=3)
|
integer_strategy = st.integers(min_value=0, max_value=3)
|
||||||
expression_count = draw(integer_strategy)
|
expression_count = draw(integer_strategy)
|
||||||
content = []
|
content = []
|
||||||
for _ in range(expression_count):
|
for _ in range(expression_count):
|
||||||
expression = draw(expressions())
|
expression = draw(expressions())
|
||||||
conversion = draw(st.sampled_from(('', '!s', '!r', '!a',)))
|
conversion = draw(st.sampled_from(('', '!s', '!r', '!a',)))
|
||||||
has_specifier = draw(st.booleans())
|
has_specifier = draw(st.booleans())
|
||||||
specifier = ':' + draw(format_specifiers()) if has_specifier else ''
|
specifier = ':' + draw(format_specifiers()) if has_specifier else ''
|
||||||
content.append('{{{}{}}}'.format(expression, conversion, specifier))
|
content.append('{{{}{}}}'.format(expression, conversion, specifier))
|
||||||
content.append(draw(st.text(character_strategy)))
|
content.append(draw(st.text(character_strategy)))
|
||||||
content = ''.join(content)
|
content = ''.join(content)
|
||||||
return "f{}'{}'".format('r' if is_raw else '', content)
|
return "f{}'{}'".format('r' if is_raw else '', content)
|
||||||
|
|
||||||
|
|
||||||
@pytest.mark.skipif(PYTHON_VERSION < 3.6, reason='need at least python 3.6')
|
@pytest.mark.skipif(PYTHON_VERSION < 3.6, reason='need at least python 3.6')
|
||||||
@hypothesis.given(format_specifiers())
|
@hypothesis.given(format_specifiers())
|
||||||
def test_format_specifiers(format_specifier):
|
def test_format_specifiers(format_specifier):
|
||||||
"""Verify that format_specifiers generates valid specifiers"""
|
"""Verify that format_specifiers generates valid specifiers"""
|
||||||
try:
|
try:
|
||||||
exec('"{:' + format_specifier + '}".format(0)')
|
exec('"{:' + format_specifier + '}".format(0)')
|
||||||
except ValueError as e:
|
except ValueError as e:
|
||||||
if 'Unknown format code' not in str(e):
|
if 'Unknown format code' not in str(e):
|
||||||
raise
|
raise
|
||||||
|
|
||||||
|
|
||||||
def run_test(text):
|
def run_test(text):
|
||||||
hypothesis.assume(len(text))
|
hypothesis.assume(len(text))
|
||||||
hypothesis.assume("f'{" in text)
|
hypothesis.assume("f'{" in text)
|
||||||
expr = text + '\n'
|
expr = text + '\n'
|
||||||
code = compile(expr, '<string>', 'single')
|
code = compile(expr, '<string>', 'single')
|
||||||
deparsed = deparse_code(PYTHON_VERSION, code, compile_mode='single')
|
deparsed = deparse_code(PYTHON_VERSION, code, compile_mode='single')
|
||||||
recompiled = compile(deparsed.text, '<string>', 'single')
|
recompiled = compile(deparsed.text, '<string>', 'single')
|
||||||
if recompiled != code:
|
if recompiled != code:
|
||||||
assert 'dis(' + deparsed.text.strip('\n') + ')' == 'dis(' + expr.strip('\n') + ')'
|
assert 'dis(' + deparsed.text.strip('\n') + ')' == 'dis(' + expr.strip('\n') + ')'
|
||||||
|
|
||||||
|
|
||||||
@pytest.mark.skipif(PYTHON_VERSION < 3.6, reason='need at least python 3.6')
|
@pytest.mark.skipif(PYTHON_VERSION < 3.6, reason='need at least python 3.6')
|
||||||
@hypothesis.given(fstrings())
|
@hypothesis.given(fstrings())
|
||||||
def test_uncompyle_fstring(fstring):
|
def test_uncompyle_fstring(fstring):
|
||||||
"""Verify uncompyling fstring bytecode"""
|
"""Verify uncompyling fstring bytecode"""
|
||||||
run_test(fstring)
|
run_test(fstring)
|
||||||
|
|
||||||
|
|
||||||
@pytest.mark.skipif(PYTHON_VERSION < 3.6, reason='need at least python 3.6')
|
@pytest.mark.skipif(PYTHON_VERSION < 3.6, reason='need at least python 3.6')
|
||||||
@pytest.mark.parametrize('fstring', [
|
@pytest.mark.parametrize('fstring', [
|
||||||
"f'{abc}{abc!s}'",
|
"f'{abc}{abc!s}'",
|
||||||
"f'{abc}0'",
|
"f'{abc}0'",
|
||||||
])
|
])
|
||||||
def test_uncompyle_direct(fstring):
|
def test_uncompyle_direct(fstring):
|
||||||
"""useful for debugging"""
|
"""useful for debugging"""
|
||||||
run_test(fstring)
|
run_test(fstring)
|
||||||
|
@@ -1,175 +1,185 @@
|
|||||||
# std
|
|
||||||
import string
|
import string
|
||||||
# 3rd party
|
from uncompyle6 import PYTHON_VERSION
|
||||||
from hypothesis import given, assume, example, settings, strategies as st
|
|
||||||
import pytest
|
import pytest
|
||||||
# uncompyle
|
pytestmark = pytest.mark.skip(PYTHON_VERSION < 2.7,
|
||||||
from validate import validate_uncompyle
|
reason="need at least Python 2.7")
|
||||||
from test_fstring import expressions
|
|
||||||
|
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)
|
||||||
|
|
||||||
|
|
||||||
alpha = st.sampled_from(string.ascii_lowercase)
|
@st.composite
|
||||||
numbers = st.sampled_from(string.digits)
|
def function_calls(draw,
|
||||||
alphanum = st.sampled_from(string.ascii_lowercase + string.digits)
|
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
|
||||||
|
|
||||||
|
|
||||||
@st.composite
|
def test_function_no_args():
|
||||||
def function_calls(draw,
|
validate_uncompyle("fn()")
|
||||||
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.
|
@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.
|
||||||
|
|
||||||
:return: The function call text.
|
This can help reason about debugging errors in specific types of function
|
||||||
"""
|
calls.
|
||||||
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)
|
:param which: One of 'keyword', 'positional', 'star', 'double_star'
|
||||||
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
|
:return: Strategy for generating an function call isolated to specific
|
||||||
draw(st.randoms()).shuffle(arguments)
|
argument types.
|
||||||
arguments = ','.join(arguments)
|
"""
|
||||||
|
kwargs = dict(
|
||||||
function_call = 'fn({arguments})'.format(arguments=arguments)
|
max_keyword_args=0,
|
||||||
try:
|
max_positional_args=0,
|
||||||
# TODO: Figure out the exact rules for ordering of positional, keyword,
|
max_star_args=0,
|
||||||
# star args, double star args and in which versions the various
|
max_double_star_args=0,
|
||||||
# types of arguments are supported so we don't need to check that the
|
)
|
||||||
# expression compiles like this.
|
kwargs['_'.join(('min', which, 'args'))] = 1
|
||||||
compile(function_call, '<string>', 'single')
|
kwargs['_'.join(('max', which, 'args'))] = 5 if 'star' not in which else 1
|
||||||
except:
|
return function_calls(**kwargs)
|
||||||
assume(False)
|
|
||||||
return function_call
|
|
||||||
|
|
||||||
|
|
||||||
def test_function_no_args():
|
with settings(max_examples=25):
|
||||||
validate_uncompyle("fn()")
|
|
||||||
|
@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)
|
||||||
|
|
||||||
|
|
||||||
def isolated_function_calls(which):
|
@pytest.mark.xfail()
|
||||||
"""
|
def test_BUILD_CONST_KEY_MAP_BUILD_MAP_UNPACK_WITH_CALL_BUILD_TUPLE_CALL_FUNCTION_EX():
|
||||||
Returns a strategy for generating function calls, but isolated to
|
validate_uncompyle("fn(w=0,m=0,**v)")
|
||||||
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.xfail()
|
||||||
|
def test_BUILD_MAP_BUILD_MAP_UNPACK_WITH_CALL_BUILD_TUPLE_CALL_FUNCTION_EX():
|
||||||
@given(isolated_function_calls('positional'))
|
validate_uncompyle("fn(a=0,**g)")
|
||||||
@example("fn(0)")
|
|
||||||
def test_function_positional_only(expr):
|
|
||||||
validate_uncompyle(expr)
|
|
||||||
|
|
||||||
@given(isolated_function_calls('keyword'))
|
|
||||||
@example("fn(a=0)")
|
|
||||||
def test_function_call_keyword_only(expr):
|
|
||||||
validate_uncompyle(expr)
|
|
||||||
|
|
||||||
@given(isolated_function_calls('star'))
|
|
||||||
@example("fn(*items)")
|
|
||||||
def test_function_call_star_only(expr):
|
|
||||||
validate_uncompyle(expr)
|
|
||||||
|
|
||||||
@given(isolated_function_calls('double_star'))
|
|
||||||
@example("fn(**{})")
|
|
||||||
def test_function_call_double_star_only(expr):
|
|
||||||
validate_uncompyle(expr)
|
|
||||||
|
|
||||||
|
|
||||||
@pytest.mark.xfail()
|
@pytest.mark.xfail()
|
||||||
def test_BUILD_CONST_KEY_MAP_BUILD_MAP_UNPACK_WITH_CALL_BUILD_TUPLE_CALL_FUNCTION_EX():
|
def test_CALL_FUNCTION_EX():
|
||||||
validate_uncompyle("fn(w=0,m=0,**v)")
|
validate_uncompyle("fn(*g,**j)")
|
||||||
|
|
||||||
|
|
||||||
@pytest.mark.xfail()
|
@pytest.mark.xfail()
|
||||||
def test_BUILD_MAP_BUILD_MAP_UNPACK_WITH_CALL_BUILD_TUPLE_CALL_FUNCTION_EX():
|
def test_BUILD_MAP_CALL_FUNCTION_EX():
|
||||||
validate_uncompyle("fn(a=0,**g)")
|
validate_uncompyle("fn(*z,u=0)")
|
||||||
|
|
||||||
|
|
||||||
@pytest.mark.xfail()
|
@pytest.mark.xfail()
|
||||||
def test_CALL_FUNCTION_EX():
|
def test_BUILD_TUPLE_CALL_FUNCTION_EX():
|
||||||
validate_uncompyle("fn(*g,**j)")
|
validate_uncompyle("fn(**a)")
|
||||||
|
|
||||||
|
|
||||||
@pytest.mark.xfail()
|
@pytest.mark.xfail()
|
||||||
def test_BUILD_MAP_CALL_FUNCTION_EX():
|
def test_BUILD_MAP_BUILD_TUPLE_BUILD_TUPLE_UNPACK_WITH_CALL_CALL_FUNCTION_EX():
|
||||||
validate_uncompyle("fn(*z,u=0)")
|
validate_uncompyle("fn(b,b,b=0,*a)")
|
||||||
|
|
||||||
|
|
||||||
@pytest.mark.xfail()
|
@pytest.mark.xfail()
|
||||||
def test_BUILD_TUPLE_CALL_FUNCTION_EX():
|
def test_BUILD_TUPLE_BUILD_TUPLE_UNPACK_WITH_CALL_CALL_FUNCTION_EX():
|
||||||
validate_uncompyle("fn(**a)")
|
validate_uncompyle("fn(*c,v)")
|
||||||
|
|
||||||
|
|
||||||
@pytest.mark.xfail()
|
@pytest.mark.xfail()
|
||||||
def test_BUILD_MAP_BUILD_TUPLE_BUILD_TUPLE_UNPACK_WITH_CALL_CALL_FUNCTION_EX():
|
def test_BUILD_CONST_KEY_MAP_CALL_FUNCTION_EX():
|
||||||
validate_uncompyle("fn(b,b,b=0,*a)")
|
validate_uncompyle("fn(i=0,y=0,*p)")
|
||||||
|
|
||||||
|
|
||||||
@pytest.mark.xfail()
|
@pytest.mark.skip(reason='skipping property based test until all individual tests are passing')
|
||||||
def test_BUILD_TUPLE_BUILD_TUPLE_UNPACK_WITH_CALL_CALL_FUNCTION_EX():
|
@given(function_calls())
|
||||||
validate_uncompyle("fn(*c,v)")
|
def test_function_call(function_call):
|
||||||
|
validate_uncompyle(function_call)
|
||||||
|
|
||||||
@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)
|
|
||||||
|
@@ -18,46 +18,46 @@ def test_grammar():
|
|||||||
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(['expr1024', 'pos_arg', 'get_iter', 'attribute'])
|
expect_lhs = set(['pos_arg', 'get_iter', 'attribute'])
|
||||||
|
|
||||||
unused_rhs = set(['list', 'mkfunc',
|
unused_rhs = set(['list', 'mkfunc',
|
||||||
'mklambda',
|
'mklambda',
|
||||||
'unpack',])
|
'unpack',])
|
||||||
expect_right_recursive = set([('designList',
|
expect_right_recursive = set([('designList',
|
||||||
('store', 'DUP_TOP', 'designList'))])
|
('store', 'DUP_TOP', 'designList'))])
|
||||||
if PYTHON3:
|
|
||||||
expect_lhs.add('load_genexpr')
|
if PYTHON_VERSION != 3.7:
|
||||||
|
unused_rhs.add('call')
|
||||||
|
|
||||||
|
if PYTHON_VERSION > 2.6:
|
||||||
expect_lhs.add('kvlist')
|
expect_lhs.add('kvlist')
|
||||||
expect_lhs.add('kv3')
|
expect_lhs.add('kv3')
|
||||||
|
unused_rhs.add('dict')
|
||||||
|
|
||||||
|
if PYTHON3:
|
||||||
|
expect_lhs.add('load_genexpr')
|
||||||
|
|
||||||
unused_rhs = unused_rhs.union(set("""
|
unused_rhs = unused_rhs.union(set("""
|
||||||
except_pop_except generator_exp classdefdeco2
|
except_pop_except generator_exp
|
||||||
dict
|
|
||||||
""".split()))
|
""".split()))
|
||||||
if PYTHON_VERSION >= 3.0:
|
if PYTHON_VERSION >= 3.0:
|
||||||
expect_lhs.add("annotate_arg")
|
expect_lhs.add("annotate_arg")
|
||||||
expect_lhs.add("annotate_tuple")
|
expect_lhs.add("annotate_tuple")
|
||||||
unused_rhs.add("mkfunc_annotate")
|
unused_rhs.add("mkfunc_annotate")
|
||||||
unused_rhs.add('call')
|
unused_rhs.add("dict_comp")
|
||||||
if PYTHON_VERSION < 3.6:
|
unused_rhs.add("classdefdeco1")
|
||||||
# 3.6 has at least one non-custom call rule
|
if PYTHON_VERSION >= 3.5:
|
||||||
# the others don't
|
expect_right_recursive.add((('l_stmts',
|
||||||
unused_rhs.add('call')
|
('lastl_stmt', 'come_froms', 'l_stmts'))))
|
||||||
if PYTHON_VERSION == 3.5:
|
|
||||||
expect_right_recursive.add((('l_stmts',
|
|
||||||
('lastl_stmt', 'COME_FROM', 'l_stmts'))))
|
|
||||||
pass
|
|
||||||
pass
|
pass
|
||||||
else:
|
elif 3.0 < PYTHON_VERSION < 3.3:
|
||||||
expect_right_recursive.add((('l_stmts',
|
expect_right_recursive.add((('l_stmts',
|
||||||
('lastl_stmt', 'COME_FROM', 'l_stmts'))))
|
('lastl_stmt', 'COME_FROM', 'l_stmts'))))
|
||||||
# expect_lhs.add('kwargs1')
|
|
||||||
pass
|
pass
|
||||||
pass
|
pass
|
||||||
pass
|
pass
|
||||||
else:
|
else:
|
||||||
expect_lhs.add('kwarg')
|
expect_lhs.add('kwarg')
|
||||||
unused_rhs.add('call')
|
|
||||||
|
|
||||||
assert expect_lhs == set(lhs)
|
assert expect_lhs == set(lhs)
|
||||||
assert unused_rhs == set(rhs)
|
assert unused_rhs == set(rhs)
|
||||||
@@ -66,7 +66,7 @@ def test_grammar():
|
|||||||
expect_dup_rhs = frozenset([('COME_FROM',), ('CONTINUE',), ('JUMP_ABSOLUTE',),
|
expect_dup_rhs = frozenset([('COME_FROM',), ('CONTINUE',), ('JUMP_ABSOLUTE',),
|
||||||
('LOAD_CONST',),
|
('LOAD_CONST',),
|
||||||
('JUMP_BACK',), ('JUMP_FORWARD',)])
|
('JUMP_BACK',), ('JUMP_FORWARD',)])
|
||||||
reduced_dup_rhs = {k: dup_rhs[k] for k in dup_rhs if k not in expect_dup_rhs}
|
reduced_dup_rhs = dict((k, dup_rhs[k]) for k in dup_rhs if k not in expect_dup_rhs)
|
||||||
for k in reduced_dup_rhs:
|
for k in reduced_dup_rhs:
|
||||||
print(k, reduced_dup_rhs[k])
|
print(k, reduced_dup_rhs[k])
|
||||||
# assert not reduced_dup_rhs, reduced_dup_rhs
|
# assert not reduced_dup_rhs, reduced_dup_rhs
|
||||||
@@ -85,6 +85,8 @@ def test_grammar():
|
|||||||
""".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:
|
||||||
|
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')
|
||||||
|
@@ -1,19 +1,22 @@
|
|||||||
import pytest
|
import pytest
|
||||||
from uncompyle6 import PYTHON_VERSION, PYTHON3, deparse_code
|
from uncompyle6 import PYTHON_VERSION, code_deparse
|
||||||
|
pytestmark = pytest.mark.skip(PYTHON_VERSION < 2.7,
|
||||||
|
reason="need at least Python 2.7")
|
||||||
|
|
||||||
def test_single_mode():
|
if PYTHON_VERSION > 2.6:
|
||||||
single_expressions = (
|
def test_single_mode():
|
||||||
'i = 1',
|
single_expressions = (
|
||||||
'i and (j or k)',
|
'i = 1',
|
||||||
'i += 1',
|
'i and (j or k)',
|
||||||
'i = j % 4',
|
'i += 1',
|
||||||
'i = {}',
|
'i = j % 4',
|
||||||
'i = []',
|
'i = {}',
|
||||||
'for i in range(10):\n i\n',
|
'i = []',
|
||||||
'for i in range(10):\n for j in range(10):\n i + j\n',
|
'for i in range(10):\n i\n',
|
||||||
'try:\n i\nexcept Exception:\n j\nelse:\n k\n'
|
'for i in range(10):\n for j in range(10):\n i + j\n',
|
||||||
)
|
'try:\n i\nexcept Exception:\n j\nelse:\n k\n'
|
||||||
|
)
|
||||||
|
|
||||||
for expr in single_expressions:
|
for expr in single_expressions:
|
||||||
code = compile(expr + '\n', '<string>', 'single')
|
code = compile(expr + '\n', '<string>', 'single')
|
||||||
assert deparse_code(PYTHON_VERSION, code, compile_mode='single').text == expr + '\n'
|
assert code_deparse(code, compile_mode='single').text == expr + '\n'
|
||||||
|
23
pytest/test_token.py
Normal file
23
pytest/test_token.py
Normal file
@@ -0,0 +1,23 @@
|
|||||||
|
from uncompyle6.scanners.tok import Token
|
||||||
|
|
||||||
|
def test_token():
|
||||||
|
# Test token formatting of: LOAD_CONST None
|
||||||
|
t = Token('LOAD_CONST', offset=0, attr=None, pattr=None, has_arg=True)
|
||||||
|
expect = ' 0 LOAD_CONST None'
|
||||||
|
# print(t.format())
|
||||||
|
assert t
|
||||||
|
assert t.format() == expect
|
||||||
|
|
||||||
|
# Make sure equality testing of tokens ignores offset
|
||||||
|
t2 = Token('LOAD_CONST', offset=2, attr=None, pattr=None, has_arg=True)
|
||||||
|
assert t2 == t
|
||||||
|
|
||||||
|
|
||||||
|
# Make sure formatting of: LOAD_CONST False. We assume False is the 0th index
|
||||||
|
# of co_consts.
|
||||||
|
t = Token('LOAD_CONST', offset=1, attr=False, pattr=False, has_arg=True)
|
||||||
|
expect = ' 1 LOAD_CONST 0 False'
|
||||||
|
assert t.format() == expect
|
||||||
|
|
||||||
|
if __name__ == '__main__':
|
||||||
|
test_token()
|
2
pytest/testdata/if-2.7.right
vendored
2
pytest/testdata/if-2.7.right
vendored
@@ -8,5 +8,5 @@
|
|||||||
9 STORE_NAME 2 'b'
|
9 STORE_NAME 2 'b'
|
||||||
12 JUMP_FORWARD 0 'to 15'
|
12 JUMP_FORWARD 0 'to 15'
|
||||||
15_0 COME_FROM 12 '12'
|
15_0 COME_FROM 12 '12'
|
||||||
15 LOAD_CONST 0 ''
|
15 LOAD_CONST 0 None
|
||||||
18 RETURN_VALUE
|
18 RETURN_VALUE
|
||||||
|
2
pytest/testdata/ifelse-2.7.right
vendored
2
pytest/testdata/ifelse-2.7.right
vendored
@@ -11,5 +11,5 @@
|
|||||||
6 15 LOAD_CONST 1 2
|
6 15 LOAD_CONST 1 2
|
||||||
18 STORE_NAME 2 'd'
|
18 STORE_NAME 2 'd'
|
||||||
21_0 COME_FROM 12 '12'
|
21_0 COME_FROM 12 '12'
|
||||||
21 LOAD_CONST 2 ''
|
21 LOAD_CONST 2 None
|
||||||
24 RETURN_VALUE
|
24 RETURN_VALUE
|
||||||
|
@@ -6,16 +6,19 @@ import difflib
|
|||||||
import subprocess
|
import subprocess
|
||||||
import tempfile
|
import tempfile
|
||||||
import functools
|
import functools
|
||||||
# compatability
|
|
||||||
import six
|
|
||||||
# uncompyle6 / xdis
|
# uncompyle6 / xdis
|
||||||
from uncompyle6 import PYTHON_VERSION, IS_PYPY, deparse_code
|
from uncompyle6 import PYTHON_VERSION, PYTHON3, IS_PYPY, deparse_code
|
||||||
# TODO : I think we can get xdis to support the dis api (python 3 version) by doing something like this there
|
# 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.bytecode import Bytecode
|
||||||
from xdis.main import get_opcode
|
from xdis.main import get_opcode
|
||||||
opc = get_opcode(PYTHON_VERSION, IS_PYPY)
|
opc = get_opcode(PYTHON_VERSION, IS_PYPY)
|
||||||
Bytecode = functools.partial(Bytecode, opc=opc)
|
Bytecode = functools.partial(Bytecode, opc=opc)
|
||||||
|
import six
|
||||||
|
|
||||||
|
if PYTHON3:
|
||||||
|
from io import StringIO
|
||||||
|
else:
|
||||||
|
from StringIO import StringIO
|
||||||
|
|
||||||
def _dis_to_text(co):
|
def _dis_to_text(co):
|
||||||
return Bytecode(co).dis()
|
return Bytecode(co).dis()
|
||||||
|
@@ -1,3 +1,2 @@
|
|||||||
pytest>=3.0.0
|
|
||||||
flake8
|
flake8
|
||||||
hypothesis<=3.8.3
|
hypothesis<=3.0.0
|
||||||
|
@@ -1,2 +1,4 @@
|
|||||||
# Pick up stuff from setup.py
|
# Pick up stuff from setup.py
|
||||||
|
hypothesis==2.0.0
|
||||||
|
pytest
|
||||||
-e .
|
-e .
|
||||||
|
6
setup.py
6
setup.py
@@ -4,12 +4,12 @@ import sys
|
|||||||
"""Setup script for the 'uncompyle6' distribution."""
|
"""Setup script for the 'uncompyle6' distribution."""
|
||||||
|
|
||||||
SYS_VERSION = sys.version_info[0:2]
|
SYS_VERSION = sys.version_info[0:2]
|
||||||
if not ((2, 6) <= SYS_VERSION <= (3, 7)) or ((3, 0) <= SYS_VERSION <= (3, 1)):
|
if not ((2, 6) <= SYS_VERSION <= (3, 7)):
|
||||||
mess = "Python Release 2.6 .. 3.7 excluding 3.0 and 3.1 are supported in this code branch."
|
mess = "Python Release 2.6 .. 3.7 are supported in this code branch."
|
||||||
if ((2, 4) <= SYS_VERSION <= (2, 7)):
|
if ((2, 4) <= SYS_VERSION <= (2, 7)):
|
||||||
mess += ("\nFor your Python, version %s, use the python-2.4 code/branch." %
|
mess += ("\nFor your Python, version %s, use the python-2.4 code/branch." %
|
||||||
sys.version[0:3])
|
sys.version[0:3])
|
||||||
elif SYS_VERSION < (2, 4) or ((3, 0) <= SYS_VERSION <= (3, 1)):
|
elif SYS_VERSION < (2, 4):
|
||||||
mess += ("\nThis package is not supported for Python version %s."
|
mess += ("\nThis package is not supported for Python version %s."
|
||||||
% sys.version[0:3])
|
% sys.version[0:3])
|
||||||
print(mess)
|
print(mess)
|
||||||
|
1
test/.gitignore
vendored
Normal file
1
test/.gitignore
vendored
Normal file
@@ -0,0 +1 @@
|
|||||||
|
/nohup.out
|
119
test/Makefile
119
test/Makefile
@@ -1,12 +1,13 @@
|
|||||||
PHONY=check clean dist distclean test test-unit test-functional rmChangeLog clean_pyc nosetests \
|
PHONY=check clean dist distclean test test-unit test-functional rmChangeLog clean_pyc nosetests \
|
||||||
check-bytecode-1.5 check-bytecode-1 check-bytecode-2 check-bytecode-3 \
|
check-bytecode-1 check-bytecode-1.3 check-bytecode-1.4 check-bytecode-1.5 \
|
||||||
|
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 \
|
||||||
check-3.4 check-3.5 check-5.6 5.6 5.8 \
|
check-3.4 check-3.5 check-3.6 check-3.7 check-5.6 5.6 5.8 \
|
||||||
grammar-coverage-2.5 grammar-coverage-2.6 grammarcoverage-2.7 \
|
grammar-coverage-2.5 grammar-coverage-2.6 grammar-coverage-2.7 \
|
||||||
grammar-coverage-3.1 grammar-coverage-3.2 grammarcoverage-3.3 \
|
grammar-coverage-3.1 grammar-coverage-3.2 grammar-coverage-3.3 \
|
||||||
grammar-coverage-3.4 grammar-coverage-3.5 grammarcoverage-3.6
|
grammar-coverage-3.4 grammar-coverage-3.5 grammar-coverage-3.6 \
|
||||||
|
grammar-coverage-3.7
|
||||||
|
|
||||||
GIT2CL ?= git2cl
|
GIT2CL ?= git2cl
|
||||||
PYTHON ?= python
|
PYTHON ?= python
|
||||||
@@ -21,7 +22,7 @@ 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
|
$(MAKE) check-bytecode-short
|
||||||
|
|
||||||
# Run all tests
|
# Run all tests
|
||||||
check:
|
check:
|
||||||
@@ -33,31 +34,41 @@ check-2.6 check-2.7: check-bytecode-2 check-bytecode-3 check-bytecode-1 check-na
|
|||||||
#: Run working tests from Python 3.0
|
#: Run working tests from Python 3.0
|
||||||
check-3.0: check-bytecode
|
check-3.0: check-bytecode
|
||||||
$(PYTHON) test_pythonlib.py --bytecode-3.0 --weak-verify $(COMPILE)
|
$(PYTHON) test_pythonlib.py --bytecode-3.0 --weak-verify $(COMPILE)
|
||||||
|
$(PYTHON) test_pythonlib.py --bytecode-3.0-run --verify-run
|
||||||
|
|
||||||
#: Run working tests from Python 3.1
|
#: Run working tests from Python 3.1
|
||||||
check-3.1: check-bytecode
|
check-3.1: check-bytecode
|
||||||
$(PYTHON) test_pythonlib.py --bytecode-3.1 --weak-verify $(COMPILE)
|
$(PYTHON) test_pythonlib.py --bytecode-3.1 --weak-verify $(COMPILE)
|
||||||
|
$(PYTHON) test_pythonlib.py --bytecode-3.1-run --verify-run
|
||||||
|
|
||||||
#: Run working tests from Python 3.2
|
#: Run working tests from Python 3.2
|
||||||
check-3.2: check-bytecode
|
check-3.2: check-bytecode
|
||||||
$(PYTHON) test_pythonlib.py --bytecode-3.2 --weak-verify $(COMPILE)
|
$(PYTHON) test_pythonlib.py --bytecode-3.2 --weak-verify $(COMPILE)
|
||||||
|
$(PYTHON) test_pythonlib.py --bytecode-3.2-run --verify-run
|
||||||
|
|
||||||
#: Run working tests from Python 3.3
|
#: Run working tests from Python 3.3
|
||||||
check-3.3: check-bytecode
|
check-3.3: check-bytecode
|
||||||
$(PYTHON) test_pythonlib.py --bytecode-3.3 --weak-verify $(COMPILE)
|
$(PYTHON) test_pythonlib.py --bytecode-3.3 --weak-verify $(COMPILE)
|
||||||
|
$(PYTHON) test_pythonlib.py --bytecode-3.3-run --verify-run
|
||||||
|
|
||||||
#: Run working tests from Python 3.4
|
#: Run working tests from Python 3.4
|
||||||
check-3.4: check-bytecode check-3.4-ok check-2.7-ok
|
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 --weak-verify $(COMPILE)
|
||||||
|
$(PYTHON) test_pythonlib.py --bytecode-3.4-run --verify-run
|
||||||
|
|
||||||
#: Run working tests from Python 3.5
|
#: Run working tests from Python 3.5
|
||||||
check-3.5: check-bytecode
|
check-3.5: check-bytecode
|
||||||
$(PYTHON) test_pythonlib.py --bytecode-3.5 --weak-verify $(COMPILE)
|
$(PYTHON) test_pythonlib.py --bytecode-3.5 --weak-verify $(COMPILE)
|
||||||
|
$(PYTHON) test_pythonlib.py --bytecode-3.5-run --verify-run
|
||||||
|
|
||||||
#: Run working tests from Python 3.6
|
#: Run working tests from Python 3.6
|
||||||
check-3.6: check-bytecode
|
check-3.6: check-bytecode
|
||||||
$(PYTHON) test_pythonlib.py --bytecode-3.6 --weak-verify $(COMPILE)
|
$(PYTHON) test_pythonlib.py --bytecode-3.6 --weak-verify $(COMPILE)
|
||||||
|
|
||||||
|
#: Run working tests from Python 3.7
|
||||||
|
check-3.7: check-bytecode
|
||||||
|
$(PYTHON) test_pythonlib.py --bytecode-3.7 --weak-verify $(COMPILE)
|
||||||
|
|
||||||
# FIXME
|
# 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
|
||||||
5.8 5.6:
|
5.8 5.6:
|
||||||
@@ -67,7 +78,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.5
|
check-bytecode-1: check-bytecode-1.4 check-bytecode-1.5
|
||||||
|
|
||||||
#: Check deparsing bytecode 2.x only
|
#: Check deparsing bytecode 2.x only
|
||||||
check-bytecode-2:
|
check-bytecode-2:
|
||||||
@@ -81,14 +92,35 @@ check-bytecode-3:
|
|||||||
--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-pypy3.2
|
--bytecode-3.4 --bytecode-3.5 --bytecode-3.6 --bytecode-pypy3.2
|
||||||
|
|
||||||
#: Check deparsing bytecode that works running Python 2 and Python 3
|
#: Check deparsing on selected bytecode 3.x
|
||||||
|
check-bytecode-3-short:
|
||||||
|
$(PYTHON) test_pythonlib.py \
|
||||||
|
--bytecode-3.4 --bytecode-3.5 --bytecode-3.6
|
||||||
|
|
||||||
|
#: 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.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 \
|
--bytecode-2.1 --bytecode-2.2 --bytecode-2.3 --bytecode-2.4 \
|
||||||
--bytecode-2.5 --bytecode-2.6 --bytecode-2.7 \
|
--bytecode-2.5 --bytecode-2.6 --bytecode-2.7 \
|
||||||
--bytecode-pypy2.7
|
--bytecode-pypy2.7
|
||||||
|
|
||||||
|
|
||||||
|
#: Check deparsing bytecode on selected Python 2 and Python 3 versions
|
||||||
|
check-bytecode-short: check-bytecode-3-short
|
||||||
|
$(PYTHON) test_pythonlib.py \
|
||||||
|
--bytecode-2.6 --bytecode-2.7 --bytecode-pypy2.7
|
||||||
|
|
||||||
|
|
||||||
|
#: Check deparsing bytecode 1.3 only
|
||||||
|
check-bytecode-1.3:
|
||||||
|
$(PYTHON) test_pythonlib.py --bytecode-1.3
|
||||||
|
|
||||||
|
#: Check deparsing bytecode 1.4 only
|
||||||
|
check-bytecode-1.4:
|
||||||
|
$(PYTHON) test_pythonlib.py --bytecode-1.4
|
||||||
|
|
||||||
#: Check deparsing bytecode 1.5 only
|
#: Check deparsing bytecode 1.5 only
|
||||||
check-bytecode-1.5:
|
check-bytecode-1.5:
|
||||||
$(PYTHON) test_pythonlib.py --bytecode-1.5
|
$(PYTHON) test_pythonlib.py --bytecode-1.5
|
||||||
@@ -113,23 +145,29 @@ check-bytecode-2.4:
|
|||||||
check-bytecode-2.5:
|
check-bytecode-2.5:
|
||||||
$(PYTHON) test_pythonlib.py --bytecode-2.5
|
$(PYTHON) test_pythonlib.py --bytecode-2.5
|
||||||
|
|
||||||
|
#: Get grammar coverage for Python 2.4
|
||||||
|
grammar-coverage-2.4:
|
||||||
|
-rm $(COVER_DIR)/spark-grammar-24.cover
|
||||||
|
SPARK_PARSER_COVERAGE=$(COVER_DIR)/spark-grammar-2.4.cover $(PYTHON) test_pythonlib.py --bytecode-2.4
|
||||||
|
SPARK_PARSER_COVERAGE=$(COVER_DIR)/spark-grammar-2.4.cover $(PYTHON) test_pyenvlib.py --2.4.6 --max= 800
|
||||||
|
|
||||||
#: Get grammar coverage for Python 2.5
|
#: Get grammar coverage for Python 2.5
|
||||||
grammar-coverage-2.5:
|
grammar-coverage-2.5:
|
||||||
-rm $(COVER_DIR)/spark-grammar-25.cover
|
-rm $(COVER_DIR)/spark-grammar-2.5.cover || true
|
||||||
SPARK_PARSER_COVERAGE=$(COVER_DIR)/spark-grammar-25.cover $(PYTHON) test_pythonlib.py --bytecode-2.5
|
SPARK_PARSER_COVERAGE=$(COVER_DIR)/spark-grammar-2.5.cover $(PYTHON) test_pythonlib.py --bytecode-2.5
|
||||||
SPARK_PARSER_COVERAGE=$(COVER_DIR)/spark-grammar-25.cover $(PYTHON) test_pyenvlib.py --2.5.6
|
SPARK_PARSER_COVERAGE=$(COVER_DIR)/spark-grammar-2.5.cover $(PYTHON) test_pyenvlib.py --2.5.6 --max=800
|
||||||
|
|
||||||
#: Get grammar coverage for Python 2.6
|
#: Get grammar coverage for Python 2.6
|
||||||
grammar-coverage-2.6:
|
grammar-coverage-2.6:
|
||||||
-rm $(COVER_DIR)/spark-grammar-26.cover
|
-rm $(COVER_DIR)/spark-grammar-2.6.cover || true
|
||||||
SPARK_PARSER_COVERAGE=$(COVER_DIR)/spark-grammar-26.cover $(PYTHON) test_pythonlib.py --bytecode-2.6
|
SPARK_PARSER_COVERAGE=$(COVER_DIR)/spark-grammar-2.6.cover $(PYTHON) test_pythonlib.py --bytecode-2.6
|
||||||
SPARK_PARSER_COVERAGE=$(COVER_DIR)/spark-grammar-26.cover $(PYTHON) test_pyenvlib.py --2.6.9
|
SPARK_PARSER_COVERAGE=$(COVER_DIR)/spark-grammar-2.6.cover $(PYTHON) test_pyenvlib.py --2.6.9 --max=800
|
||||||
|
|
||||||
#: Get grammar coverage for Python 2.7
|
#: Get grammar coverage for Python 2.7
|
||||||
grammar-coverage-2.7:
|
grammar-coverage-2.7:
|
||||||
-rm $(COVER_DIR)/spark-grammar-27.cover
|
-rm $(COVER_DIR)/spark-grammar-2.7.cover || true
|
||||||
SPARK_PARSER_COVERAGE=$(COVER_DIR)/spark-grammar-27.cover $(PYTHON) test_pythonlib.py --bytecode-2.7
|
SPARK_PARSER_COVERAGE=$(COVER_DIR)/spark-grammar-2.7.cover $(PYTHON) test_pythonlib.py --bytecode-2.7
|
||||||
SPARK_PARSER_COVERAGE=$(COVER_DIR)/spark-grammar-27.cover $(PYTHON) test_pyenvlib.py --2.7.13
|
SPARK_PARSER_COVERAGE=$(COVER_DIR)/spark-grammar-2.7.cover $(PYTHON) test_pyenvlib.py --2.7.14 --max=600
|
||||||
|
|
||||||
#: Get grammar coverage for Python 3.0
|
#: Get grammar coverage for Python 3.0
|
||||||
grammar-coverage-3.0:
|
grammar-coverage-3.0:
|
||||||
@@ -140,33 +178,39 @@ SPARK_PARSER_COVERAGE=$(COVER_DIR)/spark-grammar-30.cover $(PYTHON) test_pythonl
|
|||||||
|
|
||||||
#: Get grammar coverage for Python 3.1
|
#: Get grammar coverage for Python 3.1
|
||||||
grammar-coverage-3.1:
|
grammar-coverage-3.1:
|
||||||
-rm $(COVER_DIR)/spark-grammar-31.cover
|
-rm $(COVER_DIR)/spark-grammar-3.1.cover
|
||||||
SPARK_PARSER_COVERAGE=$(COVER_DIR)/spark-grammar-31.cover $(PYTHON) test_pythonlib.py --bytecode-3.1
|
SPARK_PARSER_COVERAGE=$(COVER_DIR)/spark-grammar-3.1.cover $(PYTHON) test_pythonlib.py --bytecode-3.1
|
||||||
SPARK_PARSER_COVERAGE=$(COVER_DIR)/spark-grammar-31.cover $(PYTHON) test_pyenvlib.py --3.1.5
|
SPARK_PARSER_COVERAGE=$(COVER_DIR)/spark-grammar-3.1.cover $(PYTHON) test_pyenvlib.py --3.1.5
|
||||||
|
|
||||||
#: Get grammar coverage for Python 3.2
|
#: Get grammar coverage for Python 3.2
|
||||||
grammar-coverage-3.2:
|
grammar-coverage-3.2:
|
||||||
-rm $(COVER_DIR)/spark-grammar-32.cover
|
-rm $(COVER_DIR)/spark-grammar-3.2.cover || true
|
||||||
SPARK_PARSER_COVERAGE=$(COVER_DIR)/spark-grammar-32.cover $(PYTHON) test_pythonlib.py --bytecode-3.2
|
SPARK_PARSER_COVERAGE=$(COVER_DIR)/spark-grammar-3.2.cover $(PYTHON) test_pythonlib.py --bytecode-3.2
|
||||||
SPARK_PARSER_COVERAGE=$(COVER_DIR)/spark-grammar-32.cover $(PYTHON) test_pyenvlib.py --3.2.6
|
SPARK_PARSER_COVERAGE=$(COVER_DIR)/spark-grammar-3.2.cover $(PYTHON) test_pyenvlib.py --3.2.6
|
||||||
|
|
||||||
#: Get grammar coverage for Python 3.3
|
#: Get grammar coverage for Python 3.3
|
||||||
grammar-coverage-3.3:
|
grammar-coverage-3.3:
|
||||||
-rm $(COVER_DIR)/spark-grammar-33.cover
|
-rm $(COVER_DIR)/spark-grammar-3.3.cover || true
|
||||||
SPARK_PARSER_COVERAGE=$(COVER_DIR)/spark-grammar-33.cover $(PYTHON) test_pythonlib.py --bytecode-3.3
|
SPARK_PARSER_COVERAGE=$(COVER_DIR)/spark-grammar-3.3.cover $(PYTHON) test_pythonlib.py --bytecode-3.3
|
||||||
SPARK_PARSER_COVERAGE=$(COVER_DIR)/spark-grammar-33.cover $(PYTHON) test_pyenvlib.py --3.3.6
|
SPARK_PARSER_COVERAGE=$(COVER_DIR)/spark-grammar-3.3.cover $(PYTHON) test_pyenvlib.py --3.3.7 --max=800
|
||||||
|
|
||||||
#: Get grammar coverage for Python 3.4
|
#: Get grammar coverage for Python 3.4
|
||||||
grammar-coverage-3.4:
|
grammar-coverage-3.4:
|
||||||
-rm $(COVER_DIR)/spark-grammar-34.cover
|
-rm $(COVER_DIR)/spark-grammar-3.4.cover || true
|
||||||
SPARK_PARSER_COVERAGE=$(COVER_DIR)/spark-grammar-34.cover $(PYTHON) test_pythonlib.py --bytecode-3.4
|
SPARK_PARSER_COVERAGE=$(COVER_DIR)/spark-grammar-3.4.cover $(PYTHON) test_pythonlib.py --bytecode-3.4
|
||||||
SPARK_PARSER_COVERAGE=$(COVER_DIR)/spark-grammar-34.cover $(PYTHON) test_pyenvlib.py --3.4.2
|
SPARK_PARSER_COVERAGE=$(COVER_DIR)/spark-grammar-3.4.cover $(PYTHON) test_pyenvlib.py --3.4.8 --max=800
|
||||||
|
|
||||||
#: Get grammar coverage for Python 3.5
|
#: Get grammar coverage for Python 3.5
|
||||||
grammar-coverage-3.5:
|
grammar-coverage-3.5:
|
||||||
rm $(COVER_DIR)/spark-grammar-35.cover || /bin/true
|
rm $(COVER_DIR)/spark-grammar-3.5.cover || /bin/true
|
||||||
SPARK_PARSER_COVERAGE=$(COVER_DIR)/spark-grammar-35.cover $(PYTHON) test_pythonlib.py --bytecode-3.5
|
SPARK_PARSER_COVERAGE=$(COVER_DIR)/spark-grammar-3.5.cover $(PYTHON) test_pythonlib.py --bytecode-3.5
|
||||||
SPARK_PARSER_COVERAGE=$(COVER_DIR)/spark-grammar-35.cover $(PYTHON) test_pyenvlib.py --3.5.3
|
SPARK_PARSER_COVERAGE=$(COVER_DIR)/spark-grammar-3.5.cover $(PYTHON) test_pyenvlib.py --3.5.5 --max=450
|
||||||
|
|
||||||
|
#: Get grammar coverage for Python 3.6
|
||||||
|
grammar-coverage-3.6:
|
||||||
|
rm $(COVER_DIR)/spark-grammar-3.6.cover || /bin/true
|
||||||
|
SPARK_PARSER_COVERAGE=$(COVER_DIR)/spark-grammar-3.6.cover $(PYTHON) test_pythonlib.py --bytecode-3.6
|
||||||
|
SPARK_PARSER_COVERAGE=$(COVER_DIR)/spark-grammar-3.6.cover $(PYTHON) test_pyenvlib.py --3.6.4 --max=280
|
||||||
|
|
||||||
#: Check deparsing Python 2.6
|
#: Check deparsing Python 2.6
|
||||||
check-bytecode-2.6:
|
check-bytecode-2.6:
|
||||||
@@ -181,14 +225,17 @@ check-bytecode-2.7:
|
|||||||
#: Check deparsing Python 3.0
|
#: Check deparsing Python 3.0
|
||||||
check-bytecode-3.0:
|
check-bytecode-3.0:
|
||||||
$(PYTHON) test_pythonlib.py --bytecode-3.0 --weak-verify
|
$(PYTHON) test_pythonlib.py --bytecode-3.0 --weak-verify
|
||||||
|
$(PYTHON) test_pythonlib.py --bytecode-3.0-run --verify-run
|
||||||
|
|
||||||
#: Check deparsing Python 3.1
|
#: Check deparsing Python 3.1
|
||||||
check-bytecode-3.1:
|
check-bytecode-3.1:
|
||||||
$(PYTHON) test_pythonlib.py --bytecode-3.1 --weak-verify
|
$(PYTHON) test_pythonlib.py --bytecode-3.1 --weak-verify
|
||||||
|
$(PYTHON) test_pythonlib.py --bytecode-3.1-run --verify-run
|
||||||
|
|
||||||
#: Check deparsing Python 3.2
|
#: Check deparsing Python 3.2
|
||||||
check-bytecode-3.2:
|
check-bytecode-3.2:
|
||||||
$(PYTHON) test_pythonlib.py --bytecode-3.2 --weak-verify
|
$(PYTHON) test_pythonlib.py --bytecode-3.2 --weak-verify
|
||||||
|
$(PYTHON) test_pythonlib.py --bytecode-3.2-run --verify-run
|
||||||
|
|
||||||
#: Check deparsing Python 3.3
|
#: Check deparsing Python 3.3
|
||||||
check-bytecode-3.3:
|
check-bytecode-3.3:
|
||||||
@@ -210,6 +257,10 @@ check-bytecode-3.6:
|
|||||||
$(PYTHON) test_pythonlib.py --bytecode-3.6 --weak-verify
|
$(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-run --verify-run
|
||||||
|
|
||||||
|
#: Check deparsing Python 3.7
|
||||||
|
check-bytecode-3.7:
|
||||||
|
$(PYTHON) test_pythonlib.py --bytecode-3.7 --weak-verify
|
||||||
|
|
||||||
#: short tests for bytecodes only for this version of Python
|
#: short tests for bytecodes only for this version of Python
|
||||||
check-native-short:
|
check-native-short:
|
||||||
$(PYTHON) test_pythonlib.py --bytecode-$(PYTHON_VERSION) --weak-verify $(COMPILE)
|
$(PYTHON) test_pythonlib.py --bytecode-$(PYTHON_VERSION) --weak-verify $(COMPILE)
|
||||||
@@ -236,7 +287,7 @@ check-3.4-ok:
|
|||||||
2.6:
|
2.6:
|
||||||
|
|
||||||
#: PyPy 5.0.x with Python 2.7 ...
|
#: PyPy 5.0.x with Python 2.7 ...
|
||||||
pypy-2.7 5.0 5.3:
|
pypy-2.7 5.0 5.3 6.0:
|
||||||
$(PYTHON) test_pythonlib.py --bytecode-pypy2.7 --verify
|
$(PYTHON) test_pythonlib.py --bytecode-pypy2.7 --verify
|
||||||
|
|
||||||
#: PyPy 2.4.x with Python 3.2 ...
|
#: PyPy 2.4.x with Python 3.2 ...
|
||||||
|
BIN
test/bytecode_1.3/test_builtin.pyc
Normal file
BIN
test/bytecode_1.3/test_builtin.pyc
Normal file
Binary file not shown.
BIN
test/bytecode_1.3/test_exceptions.pyc
Normal file
BIN
test/bytecode_1.3/test_exceptions.pyc
Normal file
Binary file not shown.
BIN
test/bytecode_1.3/test_operations.pyc
Normal file
BIN
test/bytecode_1.3/test_operations.pyc
Normal file
Binary file not shown.
BIN
test/bytecode_1.3/testall.pyc
Normal file
BIN
test/bytecode_1.3/testall.pyc
Normal file
Binary file not shown.
BIN
test/bytecode_1.4/01_print-1.4.pyc
Normal file
BIN
test/bytecode_1.4/01_print-1.4.pyc
Normal file
Binary file not shown.
BIN
test/bytecode_1.4/02_continue.pyc
Normal file
BIN
test/bytecode_1.4/02_continue.pyc
Normal file
Binary file not shown.
BIN
test/bytecode_1.4/addpack.pyc
Normal file
BIN
test/bytecode_1.4/addpack.pyc
Normal file
Binary file not shown.
BIN
test/bytecode_1.4/anydbm.pyc
Normal file
BIN
test/bytecode_1.4/anydbm.pyc
Normal file
Binary file not shown.
BIN
test/bytecode_1.4/bisect.pyc
Normal file
BIN
test/bytecode_1.4/bisect.pyc
Normal file
Binary file not shown.
BIN
test/bytecode_1.4/cmp.pyc
Normal file
BIN
test/bytecode_1.4/cmp.pyc
Normal file
Binary file not shown.
BIN
test/bytecode_1.4/cmpcache.pyc
Normal file
BIN
test/bytecode_1.4/cmpcache.pyc
Normal file
Binary file not shown.
BIN
test/bytecode_1.4/dbhash.pyc
Normal file
BIN
test/bytecode_1.4/dbhash.pyc
Normal file
Binary file not shown.
BIN
test/bytecode_1.4/emacs.pyc
Normal file
BIN
test/bytecode_1.4/emacs.pyc
Normal file
Binary file not shown.
BIN
test/bytecode_1.4/glob.pyc
Normal file
BIN
test/bytecode_1.4/glob.pyc
Normal file
Binary file not shown.
BIN
test/bytecode_1.4/test_class.pyc
Normal file
BIN
test/bytecode_1.4/test_class.pyc
Normal file
Binary file not shown.
BIN
test/bytecode_1.4/test_del.pyc
Normal file
BIN
test/bytecode_1.4/test_del.pyc
Normal file
Binary file not shown.
BIN
test/bytecode_1.4/test_docstring.pyc
Normal file
BIN
test/bytecode_1.4/test_docstring.pyc
Normal file
Binary file not shown.
BIN
test/bytecode_1.4/test_empty.pyc
Normal file
BIN
test/bytecode_1.4/test_empty.pyc
Normal file
Binary file not shown.
BIN
test/bytecode_1.4/test_exec.pyc
Normal file
BIN
test/bytecode_1.4/test_exec.pyc
Normal file
Binary file not shown.
BIN
test/bytecode_1.4/test_global.pyc
Normal file
BIN
test/bytecode_1.4/test_global.pyc
Normal file
Binary file not shown.
BIN
test/bytecode_1.4/test_globals.pyc
Normal file
BIN
test/bytecode_1.4/test_globals.pyc
Normal file
Binary file not shown.
BIN
test/bytecode_1.4/test_single_stmt.pyc
Normal file
BIN
test/bytecode_1.4/test_single_stmt.pyc
Normal file
Binary file not shown.
BIN
test/bytecode_1.5/00_unpack_list.pyc
Normal file
BIN
test/bytecode_1.5/00_unpack_list.pyc
Normal file
Binary file not shown.
Binary file not shown.
BIN
test/bytecode_2.4/03_iftrue.pyc
Normal file
BIN
test/bytecode_2.4/03_iftrue.pyc
Normal file
Binary file not shown.
BIN
test/bytecode_2.4_run/04_try_except_else.pyc
Normal file
BIN
test/bytecode_2.4_run/04_try_except_else.pyc
Normal file
Binary file not shown.
@@ -1,5 +1,5 @@
|
|||||||
These are byte-compiled programs compiled by Python 2.4
|
These are byte-compiled programs compiled by Python 2.4
|
||||||
|
|
||||||
Furthrmore the programs here are self-checking: when decompiled and
|
Furthermore, the programs here are self-checking: when decompiled and
|
||||||
then run again in a 2.4 interpreter, they will give an error if they
|
then run again in a 2.4 interpreter, they are likely to give an error when they
|
||||||
are miscompiled.
|
are miscompiled.
|
||||||
|
BIN
test/bytecode_2.5/01_inplace_true_divide.pyc
Normal file
BIN
test/bytecode_2.5/01_inplace_true_divide.pyc
Normal file
Binary file not shown.
BIN
test/bytecode_2.5/01_ops.pyc
Normal file
BIN
test/bytecode_2.5/01_ops.pyc
Normal file
Binary file not shown.
BIN
test/bytecode_2.5/02_true_divide.pyc
Normal file
BIN
test/bytecode_2.5/02_true_divide.pyc
Normal file
Binary file not shown.
BIN
test/bytecode_2.5/08_if_while_else.pyc
Normal file
BIN
test/bytecode_2.5/08_if_while_else.pyc
Normal file
Binary file not shown.
BIN
test/bytecode_2.5/10_del.pyc
Normal file
BIN
test/bytecode_2.5/10_del.pyc
Normal file
Binary file not shown.
@@ -1,5 +1,5 @@
|
|||||||
These are byte-compiled programs compiled by Python 2.5.
|
These are byte-compiled programs compiled by Python 2.5.
|
||||||
|
|
||||||
Furthrmore the programs here are self-checking: when decompiled and
|
Furthermore the programs here are self-checking: when decompiled and
|
||||||
then run again in a 2.5 interpreter, they will give an error if they
|
then run again in a 2.5 interpreter, they are likely to give an error
|
||||||
are miscompiled.
|
when they are miscompiled.
|
||||||
|
Binary file not shown.
BIN
test/bytecode_2.6/02_while1_if_and.pyc
Normal file
BIN
test/bytecode_2.6/02_while1_if_and.pyc
Normal file
Binary file not shown.
BIN
test/bytecode_2.6/04_lastc_with_loops.pyc
Normal file
BIN
test/bytecode_2.6/04_lastc_with_loops.pyc
Normal file
Binary file not shown.
BIN
test/bytecode_2.6/08_distbug.pyc
Normal file
BIN
test/bytecode_2.6/08_distbug.pyc
Normal file
Binary file not shown.
BIN
test/bytecode_2.6_run/01_ifelse_listcomp.pyc
Normal file
BIN
test/bytecode_2.6_run/01_ifelse_listcomp.pyc
Normal file
Binary file not shown.
BIN
test/bytecode_2.6_run/02_ifelse_lambda.pyc
Normal file
BIN
test/bytecode_2.6_run/02_ifelse_lambda.pyc
Normal file
Binary file not shown.
BIN
test/bytecode_2.6_run/03_complex_and.pyc-notyet
Normal file
BIN
test/bytecode_2.6_run/03_complex_and.pyc-notyet
Normal file
Binary file not shown.
@@ -1,5 +1,5 @@
|
|||||||
These are byte-compiled programs compiled by Python 2.6.
|
These are byte-compiled programs compiled by Python 2.6.
|
||||||
|
|
||||||
Furthrmore the programs here are self-checking: when decompiled and
|
Furthermore the programs here are self-checking: when decompiled and
|
||||||
then run again in a 2.6 interpreter, they will give an error if they
|
then run again in a 2.6 interpreter, they are likely to give an error
|
||||||
are miscompiled.
|
when they are miscompiled.
|
||||||
|
BIN
test/bytecode_2.7.5/01_while1.pyc
Normal file
BIN
test/bytecode_2.7.5/01_while1.pyc
Normal file
Binary file not shown.
BIN
test/bytecode_2.7/01_rel_import.pyc
Normal file
BIN
test/bytecode_2.7/01_rel_import.pyc
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
test/bytecode_2.7/03_for_try_raise.pyc
Normal file
BIN
test/bytecode_2.7/03_for_try_raise.pyc
Normal file
Binary file not shown.
Binary file not shown.
BIN
test/bytecode_2.7/04_while1_while1.pyc
Normal file
BIN
test/bytecode_2.7/04_while1_while1.pyc
Normal file
Binary file not shown.
BIN
test/bytecode_2.7/05_for_try_else.pyc
Normal file
BIN
test/bytecode_2.7/05_for_try_else.pyc
Normal file
Binary file not shown.
BIN
test/bytecode_2.7/05_try_else.pyc-notyet
Normal file
BIN
test/bytecode_2.7/05_try_else.pyc-notyet
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
test/bytecode_2.7_run/01_ifelse_listcomp.pyc
Normal file
BIN
test/bytecode_2.7_run/01_ifelse_listcomp.pyc
Normal file
Binary file not shown.
BIN
test/bytecode_2.7_run/02_assert.pyc
Normal file
BIN
test/bytecode_2.7_run/02_assert.pyc
Normal file
Binary file not shown.
BIN
test/bytecode_2.7_run/02_ifelse_lambda.pyc
Normal file
BIN
test/bytecode_2.7_run/02_ifelse_lambda.pyc
Normal file
Binary file not shown.
BIN
test/bytecode_2.7_run/04_assert_continue.pyc
Normal file
BIN
test/bytecode_2.7_run/04_assert_continue.pyc
Normal file
Binary file not shown.
BIN
test/bytecode_2.7_run/05_dict_comp.pyc
Normal file
BIN
test/bytecode_2.7_run/05_dict_comp.pyc
Normal file
Binary file not shown.
BIN
test/bytecode_2.7_run/05_not_unconditional.pyc-notyet
Normal file
BIN
test/bytecode_2.7_run/05_not_unconditional.pyc-notyet
Normal file
Binary file not shown.
@@ -1,5 +1,5 @@
|
|||||||
These are byte-compiled programs compiled by Python 2.7.
|
These are byte-compiled programs compiled by Python 2.7.
|
||||||
|
|
||||||
Furthrmore the programs here are self-checking: when decompiled and
|
Furthermore, the programs here are self-checking: when decompiled and
|
||||||
then run again in a 2.7 interpreter, they will give an error if they
|
then run again in a 2.7 interpreter, they are likely to give an error
|
||||||
are miscompiled.
|
when they are miscompiled.
|
||||||
|
Binary file not shown.
BIN
test/bytecode_3.0/01_comprehension.pyc
Normal file
BIN
test/bytecode_3.0/01_comprehension.pyc
Normal file
Binary file not shown.
BIN
test/bytecode_3.0/02_ifelse_lambda.pyc
Normal file
BIN
test/bytecode_3.0/02_ifelse_lambda.pyc
Normal file
Binary file not shown.
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user