test: Switch to Python3 25/205025/1
authorKrzysztof Kozlowski <krzk@kernel.org>
Mon, 28 May 2018 11:37:08 +0000 (13:37 +0200)
committerAmit Purwar <amit.purwar@samsung.com>
Mon, 29 Apr 2019 04:13:36 +0000 (09:43 +0530)
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'

Change-Id: Ie810df78bbcab4c772210386643d9210d25652d1
Signed-off-by: Amit Purwar <amit.purwar@samsung.com>
test/bluezutils.py

index de08cbd..cd89640 100755 (executable)
@@ -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