You've already forked python-uncompyle6
mirror of
https://github.com/rocky/python-uncompyle6.git
synced 2025-08-03 00:45:53 +08:00
Merge branch 'master' into python-2.4
This commit is contained in:
68
.github/ISSUE_TEMPLATE/bug-report.md
vendored
Normal file
68
.github/ISSUE_TEMPLATE/bug-report.md
vendored
Normal file
@@ -0,0 +1,68 @@
|
||||
---
|
||||
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 soruce 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
|
||||
|
||||
Replace this text with 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>
|
||||
...
|
||||
$
|
||||
```
|
||||
|
||||
If there is a Solidity source code, a truffle project, or bytecode
|
||||
that is involved, please provide that or links to it.
|
||||
|
||||
## Expected behavior
|
||||
|
||||
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.
|
21
.github/ISSUE_TEMPLATE/feature-request.md
vendored
Normal file
21
.github/ISSUE_TEMPLATE/feature-request.md
vendored
Normal file
@@ -0,0 +1,21 @@
|
||||
---
|
||||
name: Feature Request
|
||||
about: Tell us about a new feature that you would like to see in uncompyle6
|
||||
|
||||
---
|
||||
|
||||
## Description
|
||||
|
||||
Replace this text with a short description of the feature. This might
|
||||
include same input and output.
|
||||
|
||||
## Background
|
||||
|
||||
Replace this text with any additional background for the
|
||||
feature, for example: user scenarios, or the value of the feature.
|
||||
|
||||
## Tests
|
||||
_This section is optional._
|
||||
|
||||
Replace this text with suggestions on how to test the feature,
|
||||
if it is not obvious.
|
@@ -1,3 +1,2 @@
|
||||
pytest>=3.0.0,<=3.0.1
|
||||
flake8
|
||||
hypothesis<=3.0.0
|
||||
|
BIN
test/bytecode_2.4/03_iftrue.pyc
Normal file
BIN
test/bytecode_2.4/03_iftrue.pyc
Normal file
Binary file not shown.
@@ -32,6 +32,11 @@ class Python24Parser(Python25Parser):
|
||||
importmultiple ::= filler LOAD_CONST alias imports_cont
|
||||
import_cont ::= filler LOAD_CONST alias
|
||||
|
||||
# Handle "if true else: ..." in Python 2.4
|
||||
stmt ::= iftrue_stmt24
|
||||
iftrue_stmt24 ::= _ifstmts_jump24 suite_stmts COME_FROM
|
||||
_ifstmts_jump24 ::= c_stmts_opt JUMP_FORWARD POP_TOP
|
||||
|
||||
# Python 2.5+ omits POP_TOP POP_BLOCK
|
||||
while1stmt ::= SETUP_LOOP l_stmts_opt JUMP_BACK POP_TOP POP_BLOCK COME_FROM
|
||||
while1stmt ::= SETUP_LOOP l_stmts_opt JUMP_BACK POP_TOP POP_BLOCK
|
||||
|
@@ -43,10 +43,19 @@ def customize_for_version(self, is_pypy, version):
|
||||
'assert': ( '%|assert %c\n' , 0 ),
|
||||
'assert2': ( '%|assert %c, %c\n' , 0, 3 ),
|
||||
'try_except': ( '%|try:\n%+%c%-%c\n\n', 1, 3 ),
|
||||
'assign2': ( '%|%c, %c = %c, %c\n', 3, 4, 0, 1 ),
|
||||
'assign3': ( '%|%c, %c, %c = %c, %c, %c\n', 5, 6, 7, 0, 1, 2 ),
|
||||
'assign2': ( '%|%c, %c = %c, %c\n',
|
||||
3, 4, 0, 1 ),
|
||||
'assign3': ( '%|%c, %c, %c = %c, %c, %c\n',
|
||||
5, 6, 7, 0, 1, 2 ),
|
||||
})
|
||||
if version < 3.0:
|
||||
if version == 2.4:
|
||||
def n_iftrue_stmt24(node):
|
||||
self.template_engine(('%|%c', 0), node)
|
||||
self.default(node)
|
||||
self.prune()
|
||||
self.n_iftrue_stmt24 = n_iftrue_stmt24
|
||||
|
||||
TABLE_R.update({
|
||||
'STORE_SLICE+0': ( '%c[:]', 0 ),
|
||||
'STORE_SLICE+1': ( '%c[%p:]', 0, (1, -1) ),
|
||||
@@ -62,7 +71,7 @@ def customize_for_version(self, is_pypy, version):
|
||||
})
|
||||
|
||||
# exec as a built-in statement is only in Python 2.x
|
||||
def n_exec_stmt(self, node):
|
||||
def n_exec_stmt(node):
|
||||
"""
|
||||
exec_stmt ::= expr exprlist DUP_TOP EXEC_STMT
|
||||
exec_stmt ::= expr exprlist EXEC_STMT
|
||||
|
Reference in New Issue
Block a user