Allow Python 3.0 and fix default param bug in 3.0

This commit is contained in:
rocky 2018-06-11 11:33:50 -04:00
parent e7b62a722f
commit e3d918df3d
4 changed files with 11 additions and 9 deletions

View File

@ -35,6 +35,7 @@ classifiers = ['Development Status :: 5 - Production/Stable',
'Programming Language :: Python :: 2.5',
'Programming Language :: Python :: 2.6',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3.0',
'Programming Language :: Python :: 3.1',
'Programming Language :: Python :: 3.2',
'Programming Language :: Python :: 3.3',
@ -56,7 +57,7 @@ entry_points = {
]}
ftp_url = None
install_requires = ['spark-parser >= 1.8.5, < 1.9.0',
'xdis >= 3.8.2, < 3.9.0', 'six']
'xdis >= 3.8.2, < 3.9.0']
license = 'GPL3'
mailing_list = 'python-debugger@googlegroups.com'

View File

@ -4,12 +4,12 @@ import sys
"""Setup script for the 'uncompyle6' distribution."""
SYS_VERSION = sys.version_info[0:2]
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 are supported in this code branch."
if not ((2, 6) <= SYS_VERSION <= (3, 7)):
mess = "Python Release 2.6 .. 3.7 are supported in this code branch."
if ((2, 4) <= SYS_VERSION <= (2, 7)):
mess += ("\nFor your Python, version %s, use the python-2.4 code/branch." %
sys.version[0:3])
elif SYS_VERSION < (2, 4) or (3, 0) <= SYS_VERSION:
elif SYS_VERSION < (2, 4):
mess += ("\nThis package is not supported for Python version %s."
% sys.version[0:3])
print(mess)

View File

@ -69,12 +69,12 @@ def usage():
def main_bin():
if not (sys.version_info[0:2] in ((2, 6), (2, 7),
if not (sys.version_info[0:2] in ((2, 6), (2, 7), (3, 0),
(3, 1), (3, 2), (3, 3),
(3, 4), (3, 5), (3, 6),
(3, 7)
)):
print('Error: %s requires Python 2.6-2.7, or 3.1-3.7' % program,
print('Error: %s requires Python 2.6-3.7' % program,
file=sys.stderr)
sys.exit(-1)

View File

@ -591,8 +591,9 @@ def make_function3(self, node, is_lambda, nested=1, code_node=None):
paramnames = list(scanner_code.co_varnames[:argc])
# defaults are for last n parameters, thus reverse
if not 3.0 == self.version or self.version >= 3.6:
paramnames.reverse(); defparams.reverse()
if self.version < 3.6:
paramnames.reverse();
defparams.reverse()
try:
ast = self.build_ast(scanner_code._tokens,
@ -621,7 +622,7 @@ def make_function3(self, node, is_lambda, nested=1, code_node=None):
else:
params = paramnames
if not 3.0 == self.version or self.version >= 3.6:
if not 3.1 <= self.version < 3.6:
params.reverse() # back to correct order
if code_has_star_arg(code):