summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorColin Walters <walters@verbum.org>2010-10-08 11:53:40 -0400
committerColin Walters <walters@verbum.org>2010-10-08 11:53:40 -0400
commita743ac10f62be7582bae8ad23133685b4f98c6a8 (patch)
treeea9520a6116ef711fe0e3310d6d4636c02b7ca21
parent699c9f8332dcf1eef8ae626716d5cda3f9f5bc88 (diff)
downloadrpmci-a743ac10f62be7582bae8ad23133685b4f98c6a8.tar.gz
rpmci-a743ac10f62be7582bae8ad23133685b4f98c6a8.tar.xz
rpmci-a743ac10f62be7582bae8ad23133685b4f98c6a8.zip
Don't use subprocess.check_output, it's 2.7 only
-rw-r--r--rpmci/lame_vcs_abstraction.py9
1 files changed, 8 insertions, 1 deletions
diff --git a/rpmci/lame_vcs_abstraction.py b/rpmci/lame_vcs_abstraction.py
index 02c6149..83f1011 100644
--- a/rpmci/lame_vcs_abstraction.py
+++ b/rpmci/lame_vcs_abstraction.py
@@ -77,7 +77,14 @@ class Vcs(object):
def _vcs_exec_sync_log_error(self, args):
logging.info("Synchronously executing: %r in cwd %r" % (args, self._dir))
- return subprocess.check_output(args, stderr=subprocess.STDOUT, close_fds=True, cwd=self._dir)
+ proc = subprocess.Popen(args, stdout=subprocess.PIPE,
+ stderr=subprocess.STDOUT,
+ close_fds=True, cwd=self._dir)
+ output, err = proc.communicate()
+ ecode = proc.poll()
+ if ecode:
+ raise subprocess.CalledProcessError(ecode, args, output=output)
+ return output
def _vcs_exec_async(self, args, logfile_path, on_exited):
logging.info("Asynchronously executing: %r in cwd %r" % (args, self._dir))