You've already forked python-uncompyle6
mirror of
https://github.com/rocky/python-uncompyle6.git
synced 2025-08-03 00:45:53 +08:00
More python2 -> python3 compatibility
This commit is contained in:
@@ -1,4 +1,6 @@
|
||||
#! python
|
||||
#!/usr/bin/env python
|
||||
from __future__ import print_function
|
||||
|
||||
"""
|
||||
compile_tests -- compile test patterns for the decompyle test suite
|
||||
"""
|
||||
@@ -20,8 +22,8 @@ for opt, val in opts:
|
||||
if args:
|
||||
raise 'This tool does not want any arguments'
|
||||
|
||||
print "Using files in dir %s" % src_dir
|
||||
print "Compiling into dir %s" % work_dir
|
||||
print("Using files in dir %s" % src_dir)
|
||||
print("Compiling into dir %s" % work_dir)
|
||||
|
||||
tests = {}
|
||||
|
||||
@@ -46,6 +48,7 @@ tests['2.3'] = tests['2.2']
|
||||
tests['2.5'] = tests['2.3']
|
||||
tests['2.6'] = tests['2.5']
|
||||
tests['2.7'] = ['mine'] + tests['2.6']
|
||||
tests['3.4'] = ['mine']
|
||||
total_tests = len(tests['2.7'])
|
||||
#tests['2.2'].sort(); print tests['2.2']
|
||||
|
||||
@@ -62,13 +65,13 @@ def compile_for_version(version):
|
||||
os.mkdir(target_dir)
|
||||
for file in tests[version]:
|
||||
compile(file, target_dir)
|
||||
|
||||
|
||||
try:
|
||||
version = '%i.%i' % sys.version_info[:2]
|
||||
except AttributeError:
|
||||
version = sys.version[:3]
|
||||
|
||||
print 'Compiling test files for Python', version,
|
||||
print '(%i/%i files)' % (len(tests[version]), total_tests)
|
||||
print('Compiling test files for Python', version)
|
||||
print('(%i/%i files)' % (len(tests[version]), total_tests))
|
||||
compile_for_version(version)
|
||||
print 'Done.'
|
||||
print('Done.')
|
||||
|
Reference in New Issue
Block a user