Fixes: 59f943cd50 (commitcomment-73251597)
This commit is contained in:
pukkandan 2022-05-10 11:08:19 +05:30
parent 0f06bcd759
commit fe1daad3cb
No known key found for this signature in database
GPG key ID: 7EEE9E1E817D0A39

View file

@ -1881,8 +1881,7 @@ def write_string(s, out=None, encoding=None):
assert isinstance(s, str) assert isinstance(s, str)
out = out or sys.stderr out = out or sys.stderr
from .compat import WINDOWS_VT_MODE # Must be imported locally if compat_os_name == 'nt' and supports_terminal_sequences(out):
if WINDOWS_VT_MODE:
s = re.sub(r'([\r\n]+)', r' \1', s) s = re.sub(r'([\r\n]+)', r' \1', s)
if 'b' in getattr(out, 'mode', ''): if 'b' in getattr(out, 'mode', ''):