diff options
author | Guido Günther <agx@sigxcpu.org> | 2013-04-29 14:30:31 +0200 |
---|---|---|
committer | Guido Günther <agx@sigxcpu.org> | 2013-04-29 14:31:31 +0200 |
commit | 0c582cd827f164168a313e0bb4eabf9487bdd088 (patch) | |
tree | 21ad10d05e9f32bece2f74f3cb5c80afd46198e2 /gbp/command_wrappers.py | |
parent | 059af98c610a8c4924e42d1b62429a89f3dc5dcb (diff) |
Use Popen.communicate instead of subprocess call
so we can caputure stderr and pass it along with any errors.
Diffstat (limited to 'gbp/command_wrappers.py')
-rw-r--r-- | gbp/command_wrappers.py | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/gbp/command_wrappers.py b/gbp/command_wrappers.py index 47ad27b..8dba707 100644 --- a/gbp/command_wrappers.py +++ b/gbp/command_wrappers.py @@ -50,6 +50,7 @@ class Command(object): else: self.env = None + # FIXME: should we make this similiar to __git_inout ? def __call(self, args): """ Wraps subprocess.call so we can be verbose and fix python's @@ -64,6 +65,12 @@ class Command(object): if self.shell: # subprocess.call only cares about the first argument if shell=True cmd = " ".join(cmd) + popen = subprocess.Popen(cmd, + cwd=self.cwd, + shell=self.shell, + preexec_fn=default_sigpipe, + stderr=subprocess.PIPE) + (dummy, stderr) = popen.communicate(input) return subprocess.call(cmd, cwd=self.cwd, shell=self.shell, env=self.env, preexec_fn=default_sigpipe) |