summaryrefslogtreecommitdiffstats
path: root/tools/patman/terminal.py
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2014-08-28 09:43:35 -0600
committerSimon Glass <sjg@chromium.org>2014-09-05 13:40:41 -0600
commite752edcb6b22b2c42c8064d66a93f0910cac6fef (patch)
tree13a11ab0b2beb9930a917ba6e04b09b8d53bdbf5 /tools/patman/terminal.py
parent6ba5737ff06f09ad980cb1feee059c12bf89a7ff (diff)
downloadtalos-obmc-uboot-e752edcb6b22b2c42c8064d66a93f0910cac6fef.tar.gz
talos-obmc-uboot-e752edcb6b22b2c42c8064d66a93f0910cac6fef.zip
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 <unittest.result.TestResult run=10 errors=0 failures=0> Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'tools/patman/terminal.py')
-rw-r--r--tools/patman/terminal.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/tools/patman/terminal.py b/tools/patman/terminal.py
index 11f80d816c..963f2f891b 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.
OpenPOWER on IntegriCloud