1
0
mirror of https://github.com/yt-dlp/yt-dlp.git synced 2025-10-31 06:35:12 +00:00

[utils] Add deprecation_warning

See https://github.com/yt-dlp/yt-dlp/pull/2173#issuecomment-1097021515
This commit is contained in:
pukkandan
2022-08-30 20:58:28 +05:30
parent e1eabd7beb
commit da4db748fa
12 changed files with 67 additions and 40 deletions

View File

@@ -14,6 +14,7 @@ from .compat import compat_realpath, compat_shlex_quote
from .utils import (
Popen,
cached_method,
deprecation_warning,
shell_quote,
system_identifier,
traverse_obj,
@@ -302,11 +303,8 @@ def run_update(ydl):
def update_self(to_screen, verbose, opener):
import traceback
from .utils import write_string
write_string(
'DeprecationWarning: "yt_dlp.update.update_self" is deprecated and may be removed in a future version. '
'Use "yt_dlp.update.run_update(ydl)" instead\n')
deprecation_warning(f'"{__name__}.update_self" is deprecated and may be removed '
f'in a future version. Use "{__name__}.run_update(ydl)" instead')
printfn = to_screen