From 741f278499bbb039814789c0d11639c71512df92 Mon Sep 17 00:00:00 2001 From: Chuck Lever Date: Wed, 26 Oct 2005 14:51:58 -0400 Subject: [PATCH] Prevent stderr from appearing on stdout when running commands The original purpose was to eliminate "fatal: Needed single revision" when a ref didn't exist, but this seems like an overall good thing to do to help with output cleanliness.. Signed-off-by: Chuck Lever --- stgit/git.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/stgit/git.py b/stgit/git.py index 6b7eb83..25d9483 100644 --- a/stgit/git.py +++ b/stgit/git.py @@ -114,7 +114,7 @@ def get_conflicts(): return None def _input(cmd, file_desc): - p = popen2.Popen3(cmd) + p = popen2.Popen3(cmd, True) while True: line = file_desc.readline() if not line: @@ -125,14 +125,14 @@ def _input(cmd, file_desc): raise GitException, '%s failed' % str(cmd) def _output(cmd): - p=popen2.Popen3(cmd) + p=popen2.Popen3(cmd, True) string = p.fromchild.read() if p.wait(): raise GitException, '%s failed' % str(cmd) return string def _output_one_line(cmd, file_desc = None): - p=popen2.Popen3(cmd) + p=popen2.Popen3(cmd, True) if file_desc != None: for line in file_desc: p.tochild.write(line) @@ -143,7 +143,7 @@ def _output_one_line(cmd, file_desc = None): return string def _output_lines(cmd): - p=popen2.Popen3(cmd) + p=popen2.Popen3(cmd, True) lines = p.fromchild.readlines() if p.wait(): raise GitException, '%s failed' % str(cmd) -- 2.11.0