mirror of
https://github.com/davidhalter/jedi.git
synced 2026-02-21 12:38:28 +08:00
virtualenv progress
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user