From 73995caad33064227aa200b956668ffbc7908aa2 Mon Sep 17 00:00:00 2001 From: Peter Sobolewski <76622105+psobolewskiPhD@users.noreply.github.com> Date: Sun, 28 Jul 2024 16:25:50 -0400 Subject: [PATCH] On disable, dont try to pop a key that doesn't exist --- src/npe2/_plugin_manager.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/npe2/_plugin_manager.py b/src/npe2/_plugin_manager.py index 5ecddb65..01322d6f 100644 --- a/src/npe2/_plugin_manager.py +++ b/src/npe2/_plugin_manager.py @@ -486,7 +486,7 @@ def disable(self, plugin_name: PluginName) -> None: self._disabled_plugins.add(plugin_name) self._contrib.remove_contributions(plugin_name) - self._command_menu_map.pop(plugin_name) + self._command_menu_map.pop(plugin_name, None) self.events.enablement_changed({}, {plugin_name}) def is_disabled(self, plugin_name: str) -> bool: