From 655648f99b59c01a6efd4ba5d67900b9efd4aa0e Mon Sep 17 00:00:00 2001 From: Pino Toscano Date: Wed, 6 May 2015 16:16:24 +0200 Subject: [PATCH] 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 7f410aaff211a1d84f63e7ddf63b0a8badebea0a. Change-Id: I279bdf433b1272a9c3af4d66a2a52c78a7ac5de2 --- elements/package-installs/bin/package-installs-v2 | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/elements/package-installs/bin/package-installs-v2 b/elements/package-installs/bin/package-installs-v2 index d8567753..d5fe4d84 100755 --- a/elements/package-installs/bin/package-installs-v2 +++ b/elements/package-installs/bin/package-installs-v2 @@ -30,7 +30,9 @@ def process_output(cmdline): proc = subprocess.Popen(cmdline, stdout=subprocess.PIPE) out = proc.communicate()[0] if proc.returncode: - raise subprocess.CalledProcessError(proc.returncode, cmdline, out) + e = subprocess.CalledProcessError(proc.returncode, cmdline) + e.output = out + raise e return out