summaryrefslogtreecommitdiff
path: root/tools/patman/terminal.py
diff options
context:
space:
mode:
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 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.