From 1c1c29942e1c109b9a189442fd35972e42e82194 Mon Sep 17 00:00:00 2001 From: dece Date: Mon, 17 Jan 2022 09:57:57 +0100 Subject: [PATCH] wordreference: fix crash if no colorama available --- wordreference.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/wordreference.py b/wordreference.py index dae519f..4b5a76e 100755 --- a/wordreference.py +++ b/wordreference.py @@ -71,13 +71,13 @@ def main(): args = ap.parse_args() global Fore, Style - if args.no_color and HAS_COLORAMA: - Fore = DummyColorama() - Style = DummyColorama() - else: + if HAS_COLORAMA and not args.no_color: Fore = colorama.Fore Style = colorama.Style colorama.init() + else: + Fore = DummyColorama() + Style = DummyColorama() lang = args.lang words = " ".join(args.words)