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,8 +9,12 @@ import logging
|
||||||
logger = logging.getLogger()
|
logger = logging.getLogger()
|
||||||
import subprocess
|
import subprocess
|
||||||
import time
|
import time
|
||||||
|
import sys
|
||||||
|
|
||||||
try:
|
try:
|
||||||
|
if sys.version_info[0] > 2:
|
||||||
|
from gi.repository import GObject as gobject
|
||||||
|
else:
|
||||||
import gobject
|
import gobject
|
||||||
import dbus
|
import dbus
|
||||||
dbus_imported = True
|
dbus_imported = True
|
||||||
|
|
|
@ -6,8 +6,12 @@
|
||||||
|
|
||||||
import logging
|
import logging
|
||||||
logger = logging.getLogger()
|
logger = logging.getLogger()
|
||||||
|
import sys
|
||||||
|
|
||||||
try:
|
try:
|
||||||
|
if sys.version_info[0] > 2:
|
||||||
|
from gi.repository import GObject as gobject
|
||||||
|
else:
|
||||||
import gobject
|
import gobject
|
||||||
import dbus
|
import dbus
|
||||||
dbus_imported = True
|
dbus_imported = True
|
||||||
|
|
Loading…
Reference in a new issue