Refs #34768 -- Ignored lack of just_fix_windows_console() for colorama < 0.4.6.

This commit is contained in:
Mariusz Felisiak 2023-09-03 10:11:15 +02:00 committed by GitHub
parent bcd80de8b5
commit 048d75aeb1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 7 additions and 1 deletions

View File

@ -13,7 +13,13 @@ try:
# Avoid initializing colorama in non-Windows platforms. # Avoid initializing colorama in non-Windows platforms.
colorama.just_fix_windows_console() 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 HAS_COLORAMA = False
else: else:
HAS_COLORAMA = True HAS_COLORAMA = True