[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-trivial] [PATCH] device-crash-test: Convert to Python 3
From: |
Nisarg Shah |
Subject: |
[Qemu-trivial] [PATCH] device-crash-test: Convert to Python 3 |
Date: |
Thu, 17 Jan 2019 00:03:58 +0530 |
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 <address@hidden>
---
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
- [Qemu-trivial] [PATCH] device-crash-test: Convert to Python 3,
Nisarg Shah <=