From 4a4a2957c2581f73235a053abd67ee0ab08f26a2 Mon Sep 17 00:00:00 2001 From: Anish Date: Tue, 17 Mar 2026 15:15:55 +0530 Subject: [PATCH] fix: ensure current module is referenced correctly in __get_deprecation_class --- frappe/deprecation_dumpster.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frappe/deprecation_dumpster.py b/frappe/deprecation_dumpster.py index bdf91e9a38..7da00ae6e9 100644 --- a/frappe/deprecation_dumpster.py +++ b/frappe/deprecation_dumpster.py @@ -79,11 +79,11 @@ class V17FrappeDeprecationWarning(PendingFrappeDeprecationWarning): def __get_deprecation_class(graduation: str | None = None, class_name: str | None = None) -> type: + current_module = sys.modules[__name__] if graduation: # Scrub the graduation string to ensure it's a valid class name cleaned_graduation = re.sub(r"\W|^(?=\d)", "_", graduation.upper()) class_name = f"{cleaned_graduation}FrappeDeprecationWarning" - current_module = sys.modules[__name__] try: return getattr(current_module, class_name) except AttributeError: