From: Catalin Marinas Date: Sun, 18 Oct 2009 22:04:50 +0000 (+0100) Subject: Do not use stdout instead of stderr X-Git-Tag: v0.15-rc4~1 X-Git-Url: https://git.distorted.org.uk/~mdw/stgit/commitdiff_plain/e27cf297f92b3714e89b51f60335dabe4a661f8e Do not use stdout instead of stderr The MessagePrinter constructor redirects stderr to stdout if the output is not a file. This makes it difficult for tools needing to filter the error output (like Documentation/Makefile building the COMMANDS variable). Signed-off-by: Catalin Marinas --- diff --git a/stgit/out.py b/stgit/out.py index 753c176..aa66f3d 100644 --- a/stgit/out.py +++ b/stgit/out.py @@ -72,13 +72,12 @@ class MessagePrinter(object): self.__stdout = self.__stderr = Output(file.write, file.flush) else: self.__stdout = Output(sys.stdout.write, sys.stdout.flush) - self.__stderr = Output(sys.stdout.write, sys.stdout.flush) + self.__stderr = Output(sys.stderr.write, sys.stderr.flush) if file or sys.stdout.isatty(): self.__out = self.__stdout - self.__err = self.__stdout else: self.__out = Output(lambda msg: None, lambda: None) - self.__err = self.__stderr + self.__err = self.__stderr def stdout(self, line): """Write a line to stdout.""" self.__stdout.write_line(line)