Skip to content

Commit

Permalink
Simplify the code to not use assertion and exceptions.
Browse files Browse the repository at this point in the history
  • Loading branch information
PCManticore committed Dec 14, 2016
1 parent 5936066 commit 2fa1885
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions pylint/reporters/text.py
Original file line number Diff line number Diff line change
Expand Up @@ -191,9 +191,7 @@ def __init__(self, output=None, color_mapping=None):
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)
Expand Down

0 comments on commit 2fa1885

Please sign in to comment.