From f5a9f89f783c75bccd1ddb68c7b63ad57539d5b6 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Karl=20Hasselstr=C3=B6m?= Date: Wed, 29 Aug 2007 14:24:15 +0200 Subject: [PATCH] Don't fail just because a subprocess wrote stuff to stderr MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Instead, pass the message on to the user and assume the subprocess was successful. We need to do this since some git commands print warnings on stderr even though they succeed. Signed-off-by: Karl Hasselström --- stgit/run.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/stgit/run.py b/stgit/run.py index ae3a2e1..94dd98e 100644 --- a/stgit/run.py +++ b/stgit/run.py @@ -79,9 +79,12 @@ class Run: errdata = p.childerr.read() self.exitcode = p.wait() >> 8 self.__log_end(self.exitcode) - if errdata or self.exitcode not in self.__good_retvals: + if self.exitcode not in self.__good_retvals: raise self.exc('%s failed with code %d:\n%s' % (cmd[0], self.exitcode, errdata)) + if errdata: + out.warn('call to %s succeeded, but generated a warning:' % cmd[0]) + out.err_raw(errdata) return outdata def __run_noshell(self, cmd): """Run without captured IO. Note: arguments are not parsed by -- 2.11.0