Dont try to color non-utf8

This commit is contained in:
jpic 2021-04-24 11:58:36 +02:00
parent 94890226e6
commit 92246fc7be

View File

@ -101,7 +101,11 @@ class Output:
)
def highlight(self, line, highlight=True):
try:
line = line.decode('utf8') if isinstance(line, bytes) else line
except UnicodeDecodeError:
highlight = False
if not highlight or (
'\x1b[' in line
or '\033[' in line