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.
This commit is contained in:
parent
057f7533b1
commit
2cfddddd10
|
|
@ -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(),
|
||||
|
|
|
|||
Loading…
Reference in New Issue