mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-12-23 03:02:52 +01:00
setup.py: Hide 2to3's output.
This commit is contained in:
parent
08579a6305
commit
34ea319747
9
setup.py
9
setup.py
@ -32,6 +32,7 @@
|
||||
|
||||
import os
|
||||
import sys
|
||||
import tempfile
|
||||
import subprocess
|
||||
|
||||
path = os.path.dirname(__file__)
|
||||
@ -66,7 +67,13 @@ if sys.version_info < (2, 6, 0):
|
||||
elif sys.version_info[0] >= 3 and \
|
||||
not os.path.split(os.path.abspath(os.path.dirname(__file__)))[-1] == 'py3k':
|
||||
# The second condition is used to prevent this script to run recursively
|
||||
subprocess.Popen([sys.executable, os.path.join('2to3', 'run.py')]).wait()
|
||||
print('Converting code from Python 2 to Python 3. This make take a '
|
||||
'few minutes.')
|
||||
# For some reason, using open(os.devnull) makes the subprocess exit before
|
||||
# it finishes...
|
||||
subprocess.Popen([sys.executable, os.path.join('2to3', 'run.py')],
|
||||
stdout=tempfile.TemporaryFile(),
|
||||
stderr=tempfile.TemporaryFile()).wait()
|
||||
os.chdir('py3k')
|
||||
subprocess.Popen([sys.executable] + sys.argv).wait()
|
||||
exit()
|
||||
|
Loading…
Reference in New Issue
Block a user