From e752edcb6b22b2c42c8064d66a93f0910cac6fef Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Thu, 28 Aug 2014 09:43:35 -0600 Subject: patman: Correct unit tests to run correctly It seems that doctest behaves differently now, and some of the unit tests do not run. Adjust the tests to work correctly. ./tools/patman/patman --test Signed-off-by: Simon Glass --- tools/patman/terminal.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'tools/patman/terminal.py') diff --git a/tools/patman/terminal.py b/tools/patman/terminal.py index 11f80d8..963f2f8 100644 --- a/tools/patman/terminal.py +++ b/tools/patman/terminal.py @@ -30,8 +30,12 @@ class Color(object): enabled: True if color output should be enabled. If False then this class will not add color codes at all. """ - self._enabled = (colored == COLOR_ALWAYS or - (colored == COLOR_IF_TERMINAL and os.isatty(sys.stdout.fileno()))) + try: + self._enabled = (colored == COLOR_ALWAYS or + (colored == COLOR_IF_TERMINAL and + os.isatty(sys.stdout.fileno()))) + except: + self._enabled = False def Start(self, color, bright=True): """Returns a start color code. -- cgit v1.1