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
Loading
Please register or sign in to comment