mirror of
https://github.com/certbot/certbot.git
synced 2026-06-08 08:12:15 -04:00
More py2.6 love for StreamHandler.
This commit is contained in:
parent
9702495ff0
commit
9427c474ab
1 changed files with 4 additions and 5 deletions
|
|
@ -35,10 +35,9 @@ class StreamHandler(logging.StreamHandler):
|
|||
:rtype: str
|
||||
|
||||
"""
|
||||
output = super(StreamHandler, self).format(record)
|
||||
out = (StreamHandler.format(self, record) if sys.version_info < (2, 7)
|
||||
else super(StreamHandler, self).format(record))
|
||||
if self.colored and record.levelno >= self.red_level:
|
||||
return ''.join((le_util.ANSI_SGR_RED,
|
||||
output,
|
||||
le_util.ANSI_SGR_RESET))
|
||||
return ''.join((le_util.ANSI_SGR_RED, out, le_util.ANSI_SGR_RESET))
|
||||
else:
|
||||
return output
|
||||
return out
|
||||
|
|
|
|||
Loading…
Reference in a new issue