Commit ace54f13 authored by Simon McVittie's avatar Simon McVittie

test/name-test: Be compatible with Python 3

configure.ac will detect PYTHON=python3 if there is no python
executable in the PATH.

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=101716Reviewed-by: Philip Withnall's avatarPhilip Withnall <withnall@endlessm.com>
Signed-off-by: Simon McVittie's avatarSimon McVittie <smcv@collabora.com>
parent 1b0565ac
......@@ -7,7 +7,7 @@ try:
import dbus
import dbus.mainloop.glib
except:
print "Failed import, aborting test"
print("Failed import, aborting test")
sys.exit(0)
dbus.mainloop.glib.DBusGMainLoop(set_as_default=True)
......@@ -23,7 +23,7 @@ i = dbus.Interface(o, 'org.freedesktop.TestSuite')
# Start it up
reply = i.Echo("hello world")
print "TestSuiteForkingEchoService initial reply OK"
print("TestSuiteForkingEchoService initial reply OK")
def ignore(*args, **kwargs):
pass
......@@ -36,7 +36,7 @@ def on_forking_echo_owner_changed(name, old, new):
global o
global i
if counter > 10:
print "Activated 10 times OK, TestSuiteForkingEchoService pass"
print("Activated 10 times OK, TestSuiteForkingEchoService pass")
loop.quit()
return
counter += 1
......@@ -52,7 +52,7 @@ i.Exit(reply_handler=ignore, error_handler=ignore)
def check_counter():
if counter == 0:
print "Failed to get NameOwnerChanged for TestSuiteForkingEchoService"
print("Failed to get NameOwnerChanged for TestSuiteForkingEchoService")
sys.exit(1)
GObject.timeout_add(15000, check_counter)
......
......@@ -7,7 +7,7 @@ try:
import dbus.mainloop.glib
from gi.repository import GObject
except:
print "Failed import, aborting test"
print("Failed import, aborting test")
sys.exit(0)
dbus.mainloop.glib.DBusGMainLoop(set_as_default=True)
......@@ -16,7 +16,7 @@ loop = GObject.MainLoop()
exitcode = 0
def handle_noreceipt():
print "Failed to get signal"
print("Failed to get signal")
global exitcode
exitcode = 1
loop.quit()
......@@ -26,7 +26,7 @@ GObject.timeout_add(7000, handle_noreceipt)
bus = dbus.SessionBus()
def sighandler(*args, **kwargs):
print "got signal"
print("got signal")
loop.quit()
bus.add_signal_receiver(sighandler, dbus_interface='org.freedesktop.TestSuite', signal_name='Foo')
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment