2to3/run.py: Fix compatibility issue with old Python 3.x versions (2to3 does not suport -W and -o).

This commit is contained in:
Valentin Lorentz 2013-02-22 21:17:55 +01:00
parent d86dee6c9a
commit 78a722f38b

View File

@ -17,11 +17,14 @@ try:
except OSError: except OSError:
pass pass
os.mkdir('py3k') os.mkdir('py3k')
for dirname in ('locales', 'docs', 'plugins'): for dirname in ('locales', 'docs', 'plugins', 'src', 'test'):
shutil.copytree(dirname, os.path.join('py3k', dirname)) shutil.copytree(dirname, os.path.join('py3k', dirname))
for filename in ('setup.py',):
shutil.copyfile(filename, os.path.join('py3k', filename))
os.chdir('py3k')
files = ['run.py', 'src', 'plugins', 'test', 'setup.py'] + glob('scripts/*') files = ['run.py', 'src', 'plugins', 'test', 'setup.py'] + glob('scripts/*')
args = ['-wWno', 'py3k'] args = ['-wn']
fixers = [] fixers = []
for fix in ['all', 'def_iteritems', 'def_itervalues', 'def_iterkeys', 'reload']: for fix in ['all', 'def_iteritems', 'def_itervalues', 'def_iterkeys', 'reload']:
fixers += ['-f', fix] fixers += ['-f', fix]