diff options
author | Simon McVittie <smcv@collabora.com> | 2021-09-14 16:48:18 +0100 |
---|---|---|
committer | Simon McVittie <smcv@collabora.com> | 2021-09-15 18:49:14 +0100 |
commit | 98cbe2b3ace53ef70738345548402cb4e74a4db7 (patch) | |
tree | 8214142a629fc4d45b0fc647860b7ae4bd6b9776 /test/cross-test-client.py | |
parent | abd5b946bb2ca9b6c4d2f5e455aaaae5f38946c6 (diff) |
Remove support for Python 2
Python 2 reached EOL on 2020-01-01, and the latest version of
AX_PYTHON_DEVEL breaks the build with Python 2. This seems as good a
time as any to drop compatibility.
Signed-off-by: Simon McVittie <smcv@collabora.com>
Diffstat (limited to 'test/cross-test-client.py')
-rwxr-xr-x | test/cross-test-client.py | 16 |
1 files changed, 1 insertions, 15 deletions
diff --git a/test/cross-test-client.py b/test/cross-test-client.py index fe196ce..4c25499 100755 --- a/test/cross-test-client.py +++ b/test/cross-test-client.py @@ -35,24 +35,13 @@ except ImportError: from dbus import ( Array, Boolean, Byte, ByteArray, Double, Int16, Int32, Int64, Interface, SessionBus, String, UInt16, UInt32, UInt64) -from dbus._compat import is_py2, is_py3 import dbus.glib -if is_py2: - from dbus import UTF8String - from crosstest import ( CROSS_TEST_BUS_NAME, CROSS_TEST_PATH, INTERFACE_CALLBACK_TESTS, INTERFACE_SIGNAL_TESTS, INTERFACE_SINGLE_TESTS, INTERFACE_TESTS, SignalTestsImpl) -if is_py3: - def make_long(n): - return n -else: - def make_long(n): - return long(n) - logging.basicConfig() logging.getLogger().setLevel(1) @@ -246,8 +235,6 @@ class Client(SignalTestsImpl): # Main tests self.assert_method_eq(INTERFACE_TESTS, String('foo', variant_level=1), 'Identity', String('foo')) - if is_py2: - self.assert_method_eq(INTERFACE_TESTS, String('foo', variant_level=1), 'Identity', UTF8String('foo')) self.assert_method_eq(INTERFACE_TESTS, Byte(42, variant_level=1), 'Identity', Byte(42)) self.assert_method_eq(INTERFACE_TESTS, Byte(42, variant_level=23), 'Identity', Byte(42, variant_level=23)) self.assert_method_eq(INTERFACE_TESTS, Double(42.5, variant_level=1), 'Identity', 42.5) @@ -271,11 +258,10 @@ class Client(SignalTestsImpl): for i in (-0x7fffffff-1, 0, 42, 0x7fffffff): self.assert_method_eq(INTERFACE_TESTS, i, 'IdentityInt32', Int32(i)) for i in (0, 42, 0xffffffff): - i = make_long(i) self.assert_method_eq(INTERFACE_TESTS, i, 'IdentityUInt32', UInt32(i)) MANY = 1 for n in (0x8000, 0x10000, 0x10000, 0x10000): - MANY *= make_long(n) + MANY *= n for i in (-MANY, 0, 42, MANY-1): self.assert_method_eq(INTERFACE_TESTS, i, 'IdentityInt64', Int64(i)) for i in (0, 42, 2*MANY - 1): |