From: Karl Hasselström Date: Wed, 29 Aug 2007 12:24:15 +0000 (+0200) Subject: Don't fail just because a subprocess wrote stuff to stderr X-Git-Tag: v0.14~105 X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~mdw/git/stgit/commitdiff_plain/f5a9f89f783c75bccd1ddb68c7b63ad57539d5b6?ds=inline Don't fail just because a subprocess wrote stuff to stderr 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 --- 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