Skip to content

Commit 59e6b42

Browse files
committed
[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 fbd0b4f closes #342 Signed-off-by: Alvaro Fuentes Suarez (afu) <afu@odoo.com>
1 parent ff3001a commit 59e6b42

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/util/modules.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -310,7 +310,8 @@ def uninstall_theme(cr, theme, base_theme=None):
310310
for website in websites:
311311
IrModuleModule._theme_remove(website)
312312
flush(env_["base"])
313-
with warnings.catchwarnings(action="ignore", category=UpgradeWarning):
313+
with warnings.catch_warnings():
314+
warnings.filterwarnings(action="ignore", category=UpgradeWarning)
314315
uninstall_module(cr, theme)
315316

316317

0 commit comments

Comments
 (0)