]> git.proxmox.com Git - mirror_qemu.git/commitdiff
device-crash-test: Python 3 compatibility fix
authorNisarg Shah <nshah@disroot.org>
Wed, 16 Jan 2019 18:33:58 +0000 (00:03 +0530)
committerEduardo Habkost <ehabkost@redhat.com>
Fri, 25 Jan 2019 13:41:33 +0000 (11:41 -0200)
Restrict whitelist entry stats in debug mode to be sorted only by
"count", since Python 3 does not implicitly support comparing
dictionaries.

Signed-off-by: Nisarg Shah <nshah@disroot.org>
Message-Id: <20190116183358.30287-1-nshah@disroot.org>
[ehabkost: removed 2 unnecessary hunks from patch]
[ehabkost: edited commit message]
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
scripts/device-crash-test

index 483dafb2fc019c281eab5076460a4811e3d21014..2a13fa4f848fb6c04e90bdecb23bb8a1374c60dc 100755 (executable)
@@ -557,7 +557,8 @@ def main():
         logger.info("Skipped %d test cases", skipped)
 
     if args.debug:
-        stats = sorted([(len(wl_stats.get(i, [])), wl) for i, wl in enumerate(ERROR_WHITELIST)])
+        stats = sorted([(len(wl_stats.get(i, [])), wl) for i, wl in
+                         enumerate(ERROR_WHITELIST)], key=lambda x: x[0])
         for count, wl in stats:
             dbg("whitelist entry stats: %d: %r", count, wl)