Signed-off-by: Masashi Honma <masashi.honma@xxxxxxxxx> --- tests/hwsim/test_dbus_old.py | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/tests/hwsim/test_dbus_old.py b/tests/hwsim/test_dbus_old.py index bb6043e7e..806c03175 100644 --- a/tests/hwsim/test_dbus_old.py +++ b/tests/hwsim/test_dbus_old.py @@ -4,11 +4,16 @@ # This software may be distributed under the terms of the BSD license. # See README for more details. +import sys import logging logger = logging.getLogger() +if sys.version_info[0] > 2: + from gi.repository import GObject +else: + import gobject as GObject + try: - import gobject import dbus dbus_imported = True except ImportError: @@ -45,8 +50,8 @@ class TestDbusOldWps(TestDbus): self.event_ok = False def __enter__(self): - gobject.timeout_add(1, self.run_wps) - gobject.timeout_add(15000, self.timeout) + GObject.timeout_add(1, self.run_wps) + GObject.timeout_add(15000, self.timeout) self.add_signal(self.wpsCred, WPAS_DBUS_OLD_IFACE, "WpsCred") self.loop.run() return self @@ -123,8 +128,8 @@ def test_dbus_old_scan(dev, apdev): self.scan_completed = False def __enter__(self): - gobject.timeout_add(1, self.run_scan) - gobject.timeout_add(7000, self.timeout) + GObject.timeout_add(1, self.run_scan) + GObject.timeout_add(7000, self.timeout) self.add_signal(self.scanDone, WPAS_DBUS_OLD_IFACE, "ScanResultsAvailable") self.loop.run() @@ -489,8 +494,8 @@ def test_dbus_old_connect(dev, apdev): self.state = 0 def __enter__(self): - gobject.timeout_add(1, self.run_connect) - gobject.timeout_add(15000, self.timeout) + GObject.timeout_add(1, self.run_connect) + GObject.timeout_add(15000, self.timeout) self.add_signal(self.scanDone, WPAS_DBUS_OLD_IFACE, "ScanResultsAvailable") self.add_signal(self.stateChange, WPAS_DBUS_OLD_IFACE, @@ -579,8 +584,8 @@ def test_dbus_old_connect_eap(dev, apdev): self.certification_received = False def __enter__(self): - gobject.timeout_add(1, self.run_connect) - gobject.timeout_add(15000, self.timeout) + GObject.timeout_add(1, self.run_connect) + GObject.timeout_add(15000, self.timeout) self.add_signal(self.stateChange, WPAS_DBUS_OLD_IFACE, "StateChange") self.add_signal(self.certification, WPAS_DBUS_OLD_IFACE, -- 2.17.1 _______________________________________________ Hostap mailing list Hostap@xxxxxxxxxxxxxxxxxxx http://lists.infradead.org/mailman/listinfo/hostap