Commit 1fc0d905 authored by Guillaume Seguin's avatar Guillaume Seguin

Fix #589 by properly catching importerrors when importing dbus

parent b905b662
...@@ -65,7 +65,7 @@ else: ...@@ -65,7 +65,7 @@ else:
return return
inhibit_sleep_handler.UnInhibit(inhibit_sleep_token) inhibit_sleep_handler.UnInhibit(inhibit_sleep_token)
inhibit_sleep_token = None inhibit_sleep_token = None
except dbus.DBusException, e: except (ImportError, dbus.DBusException) as e:
logging.warning("Could not setup DBus for sleep inhibition: %s" % e) logging.warning("Could not setup DBus for sleep inhibition: %s" % e)
def inhibit_sleep(reason): def inhibit_sleep(reason):
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment