]> git.ipfire.org Git - thirdparty/nftables.git/commitdiff
tests: json_echo: Fix for Python3
authorPhil Sutter <phil@nwl.cc>
Thu, 6 Feb 2020 00:21:30 +0000 (01:21 +0100)
committerPhil Sutter <phil@nwl.cc>
Fri, 7 Feb 2020 12:28:02 +0000 (13:28 +0100)
The keys() method returns an object which does not support indexing, so
convert it to a list prior to doing so.

Fixes: a35e3a0cdc63a ("tests: json_echo: convert to py3")
Signed-off-by: Phil Sutter <phil@nwl.cc>
tests/json_echo/run-test.py

index a636d5f247702c54f8859cffbb2e407db774c320..fa7d69ab756459e514cadfb75291c89e401f0b53 100755 (executable)
@@ -119,7 +119,7 @@ def get_handle(output, search):
             else:
                 data = item
 
-            k = search.keys()[0]
+            k = list(search.keys())[0]
 
             if not k in data:
                 continue