You've already forked python-uncompyle6
mirror of
https://github.com/rocky/python-uncompyle6.git
synced 2025-08-03 00:45:53 +08:00
Can run on 3.1. Fix some 3.1 function-call bugs
This commit is contained in:
@@ -35,6 +35,7 @@ classifiers = ['Development Status :: 5 - Production/Stable',
|
|||||||
'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.1',
|
||||||
'Programming Language :: Python :: 3.2',
|
'Programming Language :: Python :: 3.2',
|
||||||
'Programming Language :: Python :: 3.3',
|
'Programming Language :: Python :: 3.3',
|
||||||
'Programming Language :: Python :: 3.4',
|
'Programming Language :: Python :: 3.4',
|
||||||
|
@@ -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.5 3.6.4 2.6.9 3.3.7 2.7.14 3.2.6 3.4.8'
|
export PYVERSIONS='3.5.5 3.6.4 2.6.9 3.3.7 2.7.14 3.2.6 3.1.5 3.4.8'
|
||||||
|
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)) or ((3, 0) <= SYS_VERSION <= (3, 0)):
|
||||||
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 excluding 3.0 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) or (3, 0) <= SYS_VERSION:
|
||||||
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)
|
||||||
|
BIN
test/bytecode_3.1/04_call_function.pyc
Normal file
BIN
test/bytecode_3.1/04_call_function.pyc
Normal file
Binary file not shown.
@@ -523,7 +523,7 @@ def make_function3(self, node, is_lambda, nested=1, codeNode=None):
|
|||||||
lc_index = -3
|
lc_index = -3
|
||||||
pass
|
pass
|
||||||
|
|
||||||
if (3.2 <= self.version <= 3.3 and len(node) > 2 and
|
if (3.1 <= self.version <= 3.3 and len(node) > 2 and
|
||||||
node[lambda_index] != 'LOAD_LAMBDA' and
|
node[lambda_index] != 'LOAD_LAMBDA' and
|
||||||
(have_kwargs or node[lc_index].kind != 'load_closure')):
|
(have_kwargs or node[lc_index].kind != 'load_closure')):
|
||||||
|
|
||||||
@@ -591,7 +591,7 @@ def make_function3(self, node, is_lambda, nested=1, codeNode=None):
|
|||||||
paramnames = list(scanner_code.co_varnames[:argc])
|
paramnames = list(scanner_code.co_varnames[:argc])
|
||||||
|
|
||||||
# defaults are for last n parameters, thus reverse
|
# defaults are for last n parameters, thus reverse
|
||||||
if not 3.0 <= self.version <= 3.1 or self.version >= 3.6:
|
if not 3.0 == self.version or self.version >= 3.6:
|
||||||
paramnames.reverse(); defparams.reverse()
|
paramnames.reverse(); defparams.reverse()
|
||||||
|
|
||||||
try:
|
try:
|
||||||
@@ -621,7 +621,7 @@ def make_function3(self, node, is_lambda, nested=1, codeNode=None):
|
|||||||
else:
|
else:
|
||||||
params = paramnames
|
params = paramnames
|
||||||
|
|
||||||
if not 3.0 <= self.version <= 3.1 or self.version >= 3.6:
|
if not 3.0 == self.version or self.version >= 3.6:
|
||||||
params.reverse() # back to correct order
|
params.reverse() # back to correct order
|
||||||
|
|
||||||
if code_has_star_arg(code):
|
if code_has_star_arg(code):
|
||||||
|
Reference in New Issue
Block a user