From c669c195dba01b5f772efe5efb5eb0ca7350f7f6 Mon Sep 17 00:00:00 2001 From: David Zuelke Date: Tue, 16 Feb 2016 22:24:37 +0100 Subject: [PATCH] redirect subprocess stderr to stdout --- bob/models.py | 3 +-- bob/utils.py | 6 +++--- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/bob/models.py b/bob/models.py index 321940d..1c62a6b 100644 --- a/bob/models.py +++ b/bob/models.py @@ -128,8 +128,7 @@ class Formula(object): if p.returncode != 0: print - print 'ERROR: An error occurred:' - pipe(p.stderr, sys.stderr, indent=True) + print 'ERROR: An error occurred.' exit(1) diff --git a/bob/utils.py b/bob/utils.py index 7e3b059..b7d202a 100644 --- a/bob/utils.py +++ b/bob/utils.py @@ -3,7 +3,7 @@ import os import re import tarfile -from subprocess import Popen, PIPE +from subprocess import Popen, PIPE, STDOUT def iter_marker_lines(marker, formula, strip=True): """Extracts any markers from a given formula.""" @@ -27,8 +27,8 @@ def mkdir_p(path): def process(cmd, cwd=None): - """A simple wrapper around the subprocess module.""" - p = Popen(cmd, cwd=cwd, shell=False, stdout=PIPE, stderr=PIPE) + """A simple wrapper around the subprocess module; stderr is redirected to stdout.""" + p = Popen(cmd, cwd=cwd, shell=False, stdout=PIPE, stderr=STDOUT) return p