virtualenv progress

This commit is contained in:
Dave Halter
2017-11-05 15:02:40 +01:00
parent baafea4a90
commit 421ea222d1
4 changed files with 136 additions and 2 deletions

View File

@@ -289,3 +289,25 @@ def utf8_repr(func):
return func
else:
return wrapper
try:
from subprocess import check_output
except ImportError:
def check_output(*popenargs, **kwargs):
"""
Taken from Python 2.6.
"""
from subprocess import Popen, PIPE, CalledProcessError
if 'stdout' in kwargs:
raise ValueError('stdout argument not allowed, it will be overridden.')
process = Popen(stdout=PIPE, *popenargs, **kwargs)
output, unused_err = process.communicate()
retcode = process.poll()
if retcode:
cmd = kwargs.get("args")
if cmd is None:
cmd = popenargs[0]
raise CalledProcessError(retcode, cmd, output=output)
return output