From 42e4c4ab2235cb6e22dd1b656f84f8409b6474eb Mon Sep 17 00:00:00 2001 From: Alvaro Fuentes Date: Thu, 16 Oct 2025 13:02:29 +0200 Subject: [PATCH] [FIX] util/modules: fix wrong usage of warnings filtering It's `catch_warnings` not `catchwarnings` https://docs.python.org/2/library/warnings.html#warnings.catch_warnings https://docs.python.org/3/library/warnings.html#warnings.catch_warnings The context manager is meant to allow for specific filters that would be reverted once it exists. This patch corrects the usage. Oversight of fbd0b4ff4812d1495e977d0985abc832b357795e --- src/util/modules.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/util/modules.py b/src/util/modules.py index d55500313..7c06c8ed0 100644 --- a/src/util/modules.py +++ b/src/util/modules.py @@ -310,7 +310,8 @@ def uninstall_theme(cr, theme, base_theme=None): for website in websites: IrModuleModule._theme_remove(website) flush(env_["base"]) - with warnings.catchwarnings(action="ignore", category=UpgradeWarning): + with warnings.catch_warnings(): + warnings.filterwarnings(action="ignore", category=UpgradeWarning) uninstall_module(cr, theme)