mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-12-01 17:23:59 +00:00
Bug 831081 - kill VirtualenvManager._check_output() now that we require python 2.7;r=gps
This commit is contained in:
parent
1ab50d1c73
commit
58a102b2fc
@ -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."""
|
||||
|
Loading…
Reference in New Issue
Block a user