qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] device-crash-test: Convert to Python 3
@ 2019-01-16 18:33 Nisarg Shah
  2019-01-23 18:50 ` Eduardo Habkost
  0 siblings, 1 reply; 3+ messages in thread
From: Nisarg Shah @ 2019-01-16 18:33 UTC (permalink / raw)
  To: qemu-devel; +Cc: qemu-trivial, ehabkost, Nisarg Shah

Apply 2to3 tool to scripts/device-crash-test.
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>
---
 scripts/device-crash-test | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/scripts/device-crash-test b/scripts/device-crash-test
index e93a7c0c84..ecdc9828c2 100755
--- a/scripts/device-crash-test
+++ b/scripts/device-crash-test
@@ -23,7 +23,7 @@
 Run QEMU with all combinations of -machine and -device types,
 check for crashes and unexpected errors.
 """
-from __future__ import print_function
+
 
 import sys
 import os
@@ -272,7 +272,7 @@ def qemuOptsEscape(s):
 
 def formatTestCase(t):
     """Format test case info as "key=value key=value" for prettier logging output"""
-    return ' '.join('%s=%s' % (k, v) for k, v in t.items())
+    return ' '.join('%s=%s' % (k, v) for k, v in list(t.items()))
 
 
 def qomListTypeNames(vm, **kwargs):
@@ -574,7 +574,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)
 
-- 
2.19.2

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2019-01-30 18:00 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-01-16 18:33 [Qemu-devel] [PATCH] device-crash-test: Convert to Python 3 Nisarg Shah
2019-01-23 18:50 ` Eduardo Habkost
2019-01-30 18:00   ` Nisarg Shah

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).