From bbe43dccf47163cc23400d1d74924c93cc9167e2 Mon Sep 17 00:00:00 2001 From: Tobias Witek Date: Sat, 27 May 2017 13:29:08 +0200 Subject: [PATCH] [modules/spotify] More generic error handling OK - I admit it: Mostly for the benefit of Travis and automated testing, which complains about the DBusException, move to a more generic exception. However, this is probably a good idea anyhow, because independently of the error, setting the song to an empty string is probably the best bet. --- bumblebee/modules/spotify.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/bumblebee/modules/spotify.py b/bumblebee/modules/spotify.py index e4fd87a..da7d032 100644 --- a/bumblebee/modules/spotify.py +++ b/bumblebee/modules/spotify.py @@ -14,7 +14,6 @@ import bumblebee.engine try: import dbus - from dbus.exceptions import DBusException except ImportError: pass @@ -36,7 +35,7 @@ class Module(bumblebee.engine.Module): spotify_iface = dbus.Interface(spotify, 'org.freedesktop.DBus.Properties') props = spotify_iface.Get('org.mpris.MediaPlayer2.Player', 'Metadata') self._song = (str(props['xesam:artist'][0]) + " - " + str(props['xesam:title'])) - except DBusException: + except Exception: self._song = "" # vim: tabstop=8 expandtab shiftwidth=4 softtabstop=4