From fe1daad3cb224904cc72462204da5f6427be6f44 Mon Sep 17 00:00:00 2001 From: pukkandan Date: Tue, 10 May 2022 11:08:19 +0530 Subject: [PATCH] Bugfix for 59f943cd5097e9bdbc3cb3e6b5675e43d369341a Fixes: https://github.com/yt-dlp/yt-dlp/commit/59f943cd5097e9bdbc3cb3e6b5675e43d369341a#commitcomment-73251597 --- yt_dlp/utils.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/yt_dlp/utils.py b/yt_dlp/utils.py index 62dc412a8..c9589537f 100644 --- a/yt_dlp/utils.py +++ b/yt_dlp/utils.py @@ -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', ''):