From 5e3a97992b206037c137a8cfda1a2c2f18fac45a Mon Sep 17 00:00:00 2001 From: Simon McVittie Date: Mon, 2 Sep 2019 14:24:36 +0100 Subject: Fix NO_REPLY test for Python 3 Signed-off-by: Simon McVittie --- test/test-client.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/test/test-client.py b/test/test-client.py index 59e432c..f028ced 100755 --- a/test/test-client.py +++ b/test/test-client.py @@ -209,6 +209,7 @@ class TestDBusBindings(unittest.TestCase): failures = [] report = [] main_loop = gobject.MainLoop() + unicode_type = (str if is_py3 else unicode) def message_filter(conn, m): print('Message filter received message: %r, %r' % (m, m.get_args_list())) @@ -217,7 +218,7 @@ class TestDBusBindings(unittest.TestCase): failures.append('Message filter called on unexpected bus') for a in m.get_args_list(): - if isinstance(a, unicode): + if isinstance(a, unicode_type): if SHOULD_NOT_HAPPEN in a: failures.append('Had an unexpected reply') elif a == 'TestNoReply report': -- cgit v1.2.1