Skip to content
Commit 318a9768 authored by Nick Rosbrook's avatar Nick Rosbrook
Browse files

DistUpgrade: gracefully handle missing dbus module

Commit ef1158e4 ("DistUpgrade: use org.freedesktop.ScreenSaver to inhibit screen lock")
added a dependency on python3-dbus, but this added dependency was not
SRU'd to any stable releases. In most cases this is not an issue because
python3-dbus is seeded, but there is no guarantee that the package will
be present on the system.

Move the `import dbus` statement to the try block in _inhibitIdle(), and
handle any ImportErrors the same way as dbus exceptions, i.e. log the
exception and inform the user that they should manually disable their
screensaver. Note that we catch Exception rather than ImportError and
dbus.exceptions.DBusException explicitly because the latter will not be
defined if an ImportError occurs.

LP: #1965568
parent 9d7c0836
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment