From 048d75aeb1e2b1c08b1b9ec359397f00aec1b57d Mon Sep 17 00:00:00 2001 From: Mariusz Felisiak Date: Sun, 3 Sep 2023 10:11:15 +0200 Subject: [PATCH] Refs #34768 -- Ignored lack of just_fix_windows_console() for colorama < 0.4.6. --- django/core/management/color.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/django/core/management/color.py b/django/core/management/color.py index 3bcefcd9901e..eef64b224920 100644 --- a/django/core/management/color.py +++ b/django/core/management/color.py @@ -13,7 +13,13 @@ # Avoid initializing colorama in non-Windows platforms. colorama.just_fix_windows_console() -except (ImportError, OSError): +except ( + AttributeError, # colorama <= 0.4.6. + ImportError, # colorama is not installed. + # If just_fix_windows_console() accesses sys.stdout with + # WSGIRestrictedStdout. + OSError, +): HAS_COLORAMA = False else: HAS_COLORAMA = True