diff options
author | Diego Rondini <diego.rondini@kynetics.com> | 2022-04-19 17:09:49 +0200 |
---|---|---|
committer | Luiz Augusto von Dentz <luiz.von.dentz@intel.com> | 2022-04-19 15:32:16 -0700 |
commit | a1939bd51e0faba9a8550eea2590d99cb63a33c1 (patch) | |
tree | bf6bad910f03549967c1f9f8e919444f2876147d /test/test-discovery | |
parent | 832b594a25051b11345c3491dd20958c22278dfe (diff) | |
download | bluez-a1939bd51e0faba9a8550eea2590d99cb63a33c1.tar.gz |
test: changes for Python3
Remove some leftover usage of Python2 code. In particular replace
iteritems() with items() to fix the following error:
AttributeError: 'dbus.Dictionary' object has no attribute 'iteritems'
Diffstat (limited to 'test/test-discovery')
-rwxr-xr-x | test/test-discovery | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/test/test-discovery b/test/test-discovery index eccc7c7e3..54fc51403 100755 --- a/test/test-discovery +++ b/test/test-discovery @@ -19,7 +19,7 @@ def print_compact(address, properties): name = "" address = "<unknown>" - for key, value in properties.iteritems(): + for key, value in properties.items(): if type(value) is dbus.String: value = unicode(value).encode('ascii', 'replace') if (key == "Name"): @@ -153,7 +153,7 @@ if __name__ == '__main__': om = dbus.Interface(bus.get_object("org.bluez", "/"), "org.freedesktop.DBus.ObjectManager") objects = om.GetManagedObjects() - for path, interfaces in objects.iteritems(): + for path, interfaces in objects.items(): if "org.bluez.Device1" in interfaces: devices[path] = interfaces["org.bluez.Device1"] |