From dad04bd4ba8165b112c36963ddcdfea51e8605d0 Mon Sep 17 00:00:00 2001 From: coletdjnz Date: Sat, 30 Nov 2024 14:36:53 +1300 Subject: [PATCH] Fix IN_CLI import --- yt_dlp/utils/_utils.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/yt_dlp/utils/_utils.py b/yt_dlp/utils/_utils.py index 4340a1ebc..4481a66ba 100644 --- a/yt_dlp/utils/_utils.py +++ b/yt_dlp/utils/_utils.py @@ -51,7 +51,6 @@ from ..compat import ( compat_HTMLParseError, ) from ..dependencies import xattr -from .._globals import IN_CLI __name__ = __name__.rsplit('.', 1)[0] # noqa: A001: Pretend to be the parent module @@ -1484,7 +1483,8 @@ def write_string(s, out=None, encoding=None): # TODO: Use global logger def deprecation_warning(msg, *, printer=None, stacklevel=0, **kwargs): - if IN_CLI.value: + from .._globals import IN_CLI as _IN_CLI + if _IN_CLI.value: if msg in deprecation_warning._cache: return deprecation_warning._cache.add(msg)