* [PATCH BlueZ v2] test: Switch to Python3
@ 2018-05-28 11:37 Krzysztof Kozlowski
0 siblings, 0 replies; only message in thread
From: Krzysztof Kozlowski @ 2018-05-28 11:37 UTC (permalink / raw)
To: linux-bluetooth; +Cc: Krzysztof Kozlowski
Python2 will be maintained till end of 2019. Switch to Python3 by
replacing iteritems() with items() to fix error when runnig test-nap:
AttributeError: 'dbus.Dictionary' object has no attribute 'iteritems'
---
Changes since v1:
1. Fix also find_device_in_objects().
---
test/bluezutils.py | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/test/bluezutils.py b/test/bluezutils.py
index de08cbdcb712..cd8964082450 100644
--- a/test/bluezutils.py
+++ b/test/bluezutils.py
@@ -15,7 +15,7 @@ def find_adapter(pattern=None):
def find_adapter_in_objects(objects, pattern=None):
bus = dbus.SystemBus()
- for path, ifaces in objects.iteritems():
+ for path, ifaces in objects.items():
adapter = ifaces.get(ADAPTER_INTERFACE)
if adapter is None:
continue
@@ -35,7 +35,7 @@ def find_device_in_objects(objects, device_address, adapter_pattern=None):
if adapter_pattern:
adapter = find_adapter_in_objects(objects, adapter_pattern)
path_prefix = adapter.object_path
- for path, ifaces in objects.iteritems():
+ for path, ifaces in objects.items():
device = ifaces.get(DEVICE_INTERFACE)
if device is None:
continue
--
2.7.4
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2018-05-28 11:37 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-05-28 11:37 [PATCH BlueZ v2] test: Switch to Python3 Krzysztof Kozlowski
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).