package-installs: fix error case for Python 2.6

subprocess.CalledProcessError in Python 2.6 does not have the 'out'
parameter for __init__, so pass only two of them and manually set
'output' in that case.

Fixes/improves commit 7f410aaff2.

Change-Id: I279bdf433b1272a9c3af4d66a2a52c78a7ac5de2
This commit is contained in:
Pino Toscano 2015-05-06 16:16:24 +02:00
parent 9ba196394c
commit 655648f99b

View File

@ -30,7 +30,9 @@ def process_output(cmdline):
proc = subprocess.Popen(cmdline, stdout=subprocess.PIPE) proc = subprocess.Popen(cmdline, stdout=subprocess.PIPE)
out = proc.communicate()[0] out = proc.communicate()[0]
if proc.returncode: if proc.returncode:
raise subprocess.CalledProcessError(proc.returncode, cmdline, out) e = subprocess.CalledProcessError(proc.returncode, cmdline)
e.output = out
raise e
return out return out