Bug 831081 - kill VirtualenvManager._check_output() now that we require python 2.7;r=gps

This commit is contained in:
Jeff Hammel 2013-01-16 16:52:21 -08:00
parent 1ab50d1c73
commit 58a102b2fc

View File

@ -245,12 +245,8 @@ class VirtualenvManager(object):
# variables like sys.path are adjusted, this could cause all kinds of
# havoc. While this may work, invoking a new process is safer.
# TODO Use check_output when we require Python 2.7.
fn = getattr(subprocess, 'check_output',
VirtualenvManager._check_output)
try:
output = fn(program, cwd=directory, stderr=subprocess.STDOUT)
output = subprocess.check_output(program, cwd=directory, stderr=subprocess.STDOUT)
print(output)
except subprocess.CalledProcessError as e:
if 'Python.h: No such file or directory' in e.output:
@ -294,21 +290,6 @@ class VirtualenvManager(object):
execfile(self.activate_path, dict(__file__=self.activate_path))
# TODO Eliminate when we require Python 2.7.
@staticmethod
def _check_output(*args, **kwargs):
"""Python 2.6 compatible implementation of subprocess.check_output."""
proc = subprocess.Popen(stdout=subprocess.PIPE, *args, **kwargs)
output, unused_err = proc.communicate()
retcode = proc.poll()
if retcode:
cmd = kwargs.get('args', args[0])
e = subprocess.CalledProcessError(retcode, cmd)
e.output = output
raise e
return output
def verify_python_version(log_handle):
"""Ensure the current version of Python is sufficient."""