Bug 1347290 - Set sgr0 to '' if blessings.tigetstr('sgr0') returns None, r=gps
authorMichael Layzell <michael@thelayzells.com>
Thu, 06 Apr 2017 17:44:30 -0700
changeset 558296 a238396507d64cfedda980e2bd3031cf1daff5df
parent 558295 ff349ab587f8f1c66a8aab20ae85ff1db831892e
child 558297 eceaa5f7c9283557e1250ec9181d04e75268b5cc
push id52860
push userbmo:walkingice0204@gmail.com
push dateFri, 07 Apr 2017 13:29:26 +0000
reviewersgps
bugs1347290
milestone55.0a1
Bug 1347290 - Set sgr0 to '' if blessings.tigetstr('sgr0') returns None, r=gps MozReview-Commit-ID: vP4izM2RwP
python/mach/mach/logging.py
--- a/python/mach/mach/logging.py
+++ b/python/mach/mach/logging.py
@@ -88,17 +88,17 @@ class StructuredHumanFormatter(logging.F
         return t
 
 
 class StructuredTerminalFormatter(StructuredHumanFormatter):
     """Log formatter for structured messages writing to a terminal."""
 
     def set_terminal(self, terminal):
         self.terminal = terminal
-        self._sgr0 = blessings.tigetstr('sgr0') if terminal and blessings else ''
+        self._sgr0 = blessings.tigetstr('sgr0') or '' if terminal and blessings else ''
 
     def format(self, record):
         f = record.msg.format(**record.params)
 
         if not self.write_times:
             return f
 
         t = self.terminal.blue(format_seconds(self._time(record)))