From f342f129c670969530c3721885ca3eade444209f Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Wed, 2 Dec 2015 18:14:34 +0100 Subject: [PATCH] Refactor how use_color is set in scripts/utils. --- scripts/utils.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/scripts/utils.py b/scripts/utils.py index c6fdacd24..6e5664c62 100644 --- a/scripts/utils.py +++ b/scripts/utils.py @@ -22,20 +22,20 @@ import os import os.path -use_color = True - # Import side-effects are an evil thing, but here it's okay so scripts using # colors work on Windows as well. try: import colorama except ImportError: - if os.name == 'nt': - use_color = False + colorama = None else: colorama.init() +use_color = os.name != 'nt' or colorama + + fg_colors = { 'black': 30, 'red': 31,