mirror of
https://fuchsia.googlesource.com/third_party/github.com/pylint-dev/pylint
synced 2024-09-20 23:51:39 +00:00
Simplify the code to not use assertion and exceptions.
This commit is contained in:
parent
5936066d92
commit
2fa1885186
|
@ -191,9 +191,7 @@ class ColorizedTextReporter(TextReporter):
|
|||
self.color_mapping = color_mapping or \
|
||||
dict(ColorizedTextReporter.COLOR_MAPPING)
|
||||
ansi_terms = ['xterm-16color', 'xterm-256color']
|
||||
try:
|
||||
assert os.environ['TERM'] in ansi_terms
|
||||
except (KeyError, AssertionError):
|
||||
if os.environ.get('TERM') not in ansi_terms:
|
||||
if sys.platform == 'win32':
|
||||
import colorama
|
||||
self.out = colorama.AnsiToWin32(self.out)
|
||||
|
|
Loading…
Reference in New Issue
Block a user