From 23476e5d572cfdb0edc5f3f4663453628e5aaa38 Mon Sep 17 00:00:00 2001 From: GitBib <15717621+GitBib@users.noreply.github.com> Date: Sun, 17 Nov 2024 13:03:07 +0300 Subject: [PATCH] Deprecate `is_bcp47` function Warn users that the `is_bcp47` function is deprecated and will be removed in a future release. Added a DeprecationWarning to inform users of this upcoming change. --- pymkv/BCP47.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/pymkv/BCP47.py b/pymkv/BCP47.py index 7c95cc1..64dad16 100644 --- a/pymkv/BCP47.py +++ b/pymkv/BCP47.py @@ -1,3 +1,4 @@ +import warnings from functools import cache import bcp47 @@ -18,6 +19,11 @@ def is_bcp47(language_ietf: str) -> bool: bool True if the language tag is a valid BCP 47 language tag, False otherwise. """ + warnings.warn( + "The function 'is_bcp47' is deprecated and will be removed in a future release.", + category=DeprecationWarning, + stacklevel=2, + ) if language_ietf != "und": return language_ietf in bcp47.languages.values() else: # noqa: RET505