Fixes #4536. NM 0.7 was never used because NameError for 'dbus' object was raised. Changed 'exception Exception' to catch only 'DBusException' from bus.get_object() method.

This commit is contained in:
Mateusz Biliński 2009-06-13 20:31:40 +02:00
parent 19a0f91bfc
commit 5026aa9655
1 changed files with 10 additions and 4 deletions

View File

@ -24,6 +24,7 @@
import sys import sys
from common import gajim from common import gajim
def device_now_active(self, *args): def device_now_active(self, *args):
'''For Network Manager 0.6''' '''For Network Manager 0.6'''
for connection in gajim.connections.itervalues(): for connection in gajim.connections.itervalues():
@ -53,9 +54,14 @@ def state_changed(state):
supported = False supported = False
from common import dbus_support
if sys.platform == 'darwin': if sys.platform == 'darwin':
supported = True supported = True
else: elif dbus_support.supported:
import dbus
import dbus.glib
try: try:
from common.dbus_support import system_bus from common.dbus_support import system_bus
@ -72,7 +78,7 @@ else:
'/org/freedesktop/NetworkManager') '/org/freedesktop/NetworkManager')
supported = True supported = True
except Exception: except dbus.DBusException:
try: try:
if 'org.freedesktop.NetworkManager' in bus.list_names(): if 'org.freedesktop.NetworkManager' in bus.list_names():
supported = True supported = True