tests: python3 compatible way of importing gobject for D-Bus testing
Signed-off-by: Jouni Malinen <j@w1.fi>
This commit is contained in:
parent
236bbda8e4
commit
5c9ba3412d
2 changed files with 10 additions and 2 deletions
|
@ -9,9 +9,13 @@ import logging
|
|||
logger = logging.getLogger()
|
||||
import subprocess
|
||||
import time
|
||||
import sys
|
||||
|
||||
try:
|
||||
import gobject
|
||||
if sys.version_info[0] > 2:
|
||||
from gi.repository import GObject as gobject
|
||||
else:
|
||||
import gobject
|
||||
import dbus
|
||||
dbus_imported = True
|
||||
except ImportError:
|
||||
|
|
|
@ -6,9 +6,13 @@
|
|||
|
||||
import logging
|
||||
logger = logging.getLogger()
|
||||
import sys
|
||||
|
||||
try:
|
||||
import gobject
|
||||
if sys.version_info[0] > 2:
|
||||
from gi.repository import GObject as gobject
|
||||
else:
|
||||
import gobject
|
||||
import dbus
|
||||
dbus_imported = True
|
||||
except ImportError:
|
||||
|
|
Loading…
Reference in a new issue