From 2cfddddd10d0f4afffa46c0c054f785f4d9f39ce Mon Sep 17 00:00:00 2001 From: Nick Price Date: Sat, 11 Jul 2026 17:43:02 -0700 Subject: [PATCH] diversion: do not name dbus in the handler that guards importing it gnome_dbus_interface_setup() imports dbus inside the try block but catches dbus.exceptions.DBusException. If the import itself raises ImportError -- dbus-python is only installed on Linux -- the name dbus is unbound, so the ImportError is not caught and merely evaluating the except clause raises NameError. Catch Exception instead. --- lib/logitech_receiver/diversion.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/logitech_receiver/diversion.py b/lib/logitech_receiver/diversion.py index b55982e5..026c7556 100644 --- a/lib/logitech_receiver/diversion.py +++ b/lib/logitech_receiver/diversion.py @@ -197,7 +197,7 @@ def gnome_dbus_interface_setup(): bus = dbus.SessionBus() remote_object = bus.get_object("org.gnome.Shell", "/io/github/pwr_solaar/solaar") _dbus_interface = dbus.Interface(remote_object, "io.github.pwr_solaar.solaar") - except dbus.exceptions.DBusException: + except Exception: logger.warning( "Solaar Gnome extension not installed - some rule capabilities inoperable", exc_info=sys.exc_info(),