summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorSimon McVittie <smcv@collabora.com>2017-07-07 12:12:24 +0100
committerSimon McVittie <smcv@collabora.com>2017-07-07 13:14:38 +0100
commitace54f13587e13ea2ebafb6127fcb47a2c2c22ac (patch)
tree0a2f0b3726b8e89563a9ffd340ef452aeddf58be /test
parent1b0565aca3d085de0962b4e58a52eae32a4a4f57 (diff)
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=101716 Reviewed-by: Philip Withnall <withnall@endlessm.com> Signed-off-by: Simon McVittie <smcv@collabora.com>
Diffstat (limited to 'test')
-rw-r--r--test/name-test/test-activation-forking.py8
-rwxr-xr-xtest/name-test/test-wait-for-echo.py6
2 files changed, 7 insertions, 7 deletions
diff --git a/test/name-test/test-activation-forking.py b/test/name-test/test-activation-forking.py
index f98537eb6..44bc1a6e5 100644
--- a/test/name-test/test-activation-forking.py
+++ b/test/name-test/test-activation-forking.py
@@ -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)
diff --git a/test/name-test/test-wait-for-echo.py b/test/name-test/test-wait-for-echo.py
index 49ecbb461..d1b9e0c4d 100755
--- a/test/name-test/test-wait-for-echo.py
+++ b/test/name-test/test-wait-for-echo.py
@@ -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')