From e27cf297f92b3714e89b51f60335dabe4a661f8e Mon Sep 17 00:00:00 2001 From: Catalin Marinas Date: Sun, 18 Oct 2009 23:04:50 +0100 Subject: [PATCH] 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 --- stgit/out.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) 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) -- 2.11.0