mirror of
https://github.com/kennethreitz/bob-builder-1.git
synced 2026-06-05 23:10:17 +00:00
redirect subprocess stderr to stdout
This commit is contained in:
+1
-2
@@ -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)
|
||||
|
||||
|
||||
|
||||
+3
-3
@@ -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
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user