From c564891dcfcd05064a52dcfd53ac611d4e880efc Mon Sep 17 00:00:00 2001 From: Peter Sobolewski <76622105+psobolewskiPhD@users.noreply.github.com> Date: Mon, 29 Jul 2024 07:45:04 -0400 Subject: [PATCH] On disable, dont try to pop a key that doesn't exist (#356) --- 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: