[compat] Suppress errors in enabling VT mode

Closes #1932
This commit is contained in:
pukkandan
2021-12-08 19:41:54 +05:30
parent ddd24c9949
commit e3c7d49571
3 changed files with 14 additions and 3 deletions

View File

@@ -6592,7 +6592,8 @@ def jwt_decode_hs256(jwt):
def supports_terminal_sequences(stream):
if compat_os_name == 'nt':
if get_windows_version() < (10, 0, 10586):
from .compat import WINDOWS_VT_MODE # Must be imported locally
if not WINDOWS_VT_MODE or get_windows_version() < (10, 0, 10586):
return False
elif not os.getenv('TERM'):
return False