From 928fc556ec3ff863960fcdd952f17f47326cfbf8 Mon Sep 17 00:00:00 2001 From: Thomas Bonfort Date: Thu, 22 Feb 2024 14:10:45 +0100 Subject: [PATCH] Avoid error when plugin loaded with QGIS_NO_OVERRIDE_IMPORT --- python/utils.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/python/utils.py b/python/utils.py index 6cf04ed388a..f09e5907e22 100644 --- a/python/utils.py +++ b/python/utils.py @@ -534,6 +534,10 @@ def unloadPlugin(packageName: str) -> bool: def _unloadPluginModules(packageName: str): """ unload plugin package with all its modules (files) """ global _plugin_modules + + if packageName not in _plugin_modules: + return + mods = _plugin_modules[packageName] for mod in mods: