From 2fa18851867e99e065f083de74be8ab8adad4b41 Mon Sep 17 00:00:00 2001 From: Claudiu Popa Date: Wed, 14 Dec 2016 10:29:59 +0200 Subject: [PATCH] Simplify the code to not use assertion and exceptions. --- pylint/reporters/text.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/pylint/reporters/text.py b/pylint/reporters/text.py index 9bd3502a4..a47d7f8ae 100644 --- a/pylint/reporters/text.py +++ b/pylint/reporters/text.py @@ -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)