aboutsummaryrefslogtreecommitdiffstats
path: root/yt_dlp/update.py
diff options
context:
space:
mode:
authorpukkandan <pukkandan.ytdlp@gmail.com>2022-08-30 20:58:28 +0530
committerpukkandan <pukkandan.ytdlp@gmail.com>2022-08-30 21:03:07 +0530
commitda4db748fa813a8de684d5ab699b8f561b982e35 (patch)
treeb3a393bb7d9ed79c698783f3ce21fc08ac642455 /yt_dlp/update.py
parente1eabd7beb4cc83338a7422546ae1c9ae8b2097f (diff)
downloadhypervideo-pre-da4db748fa813a8de684d5ab699b8f561b982e35.tar.lz
hypervideo-pre-da4db748fa813a8de684d5ab699b8f561b982e35.tar.xz
hypervideo-pre-da4db748fa813a8de684d5ab699b8f561b982e35.zip
[utils] Add `deprecation_warning`
See https://github.com/yt-dlp/yt-dlp/pull/2173#issuecomment-1097021515
Diffstat (limited to 'yt_dlp/update.py')
-rw-r--r--yt_dlp/update.py8
1 files changed, 3 insertions, 5 deletions
diff --git a/yt_dlp/update.py b/yt_dlp/update.py
index e82cdf451..026bc12aa 100644
--- a/yt_dlp/update.py
+++ b/yt_dlp/update.py
@@ -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