Skip to content

Commit

Permalink
fix deprecation warning: try the new recommended way first, fallback …
Browse files Browse the repository at this point in the history
…to the old one

git-svn-id: https://xpra.org/svn/Xpra/trunk@17579 3bb7dfac-3a0b-4e04-842a-767bc560f471
  • Loading branch information
totaam committed Dec 7, 2017
1 parent 1d6f6a2 commit 387e351
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions src/xpra/client/notifications/dbus_notifier.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,14 @@

import os
from xpra.client.notifications.notifier_base import NotifierBase, log
#beware: this import has side-effects:
import dbus.glib
assert dbus.glib
try:
#new recommended way of using the glib main loop:
from dbus.mainloop.glib import DBusGMainLoop
DBusGMainLoop(set_as_default=True)
except:
#beware: this import has side-effects:
import dbus.glib
assert dbus.glib
import dbus.exceptions

NOTIFICATION_APP_NAME = os.environ.get("XPRA_NOTIFICATION_APP_NAME", "%s (via Xpra)")
Expand Down

0 comments on commit 387e351

Please sign in to comment.