]> jfr.im git - yt-dlp.git/commitdiff
Bugfix for 59f943cd5097e9bdbc3cb3e6b5675e43d369341a
authorpukkandan <redacted>
Tue, 10 May 2022 05:38:19 +0000 (11:08 +0530)
committerpukkandan <redacted>
Tue, 10 May 2022 05:38:58 +0000 (11:08 +0530)
Fixes: https://github.com/yt-dlp/yt-dlp/commit/59f943cd5097e9bdbc3cb3e6b5675e43d369341a#commitcomment-73251597
yt_dlp/utils.py

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