From nobody Fri Nov 7 08:00:28 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=disroot.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1547663897946565.9264770383571; Wed, 16 Jan 2019 10:38:17 -0800 (PST) Received: from localhost ([127.0.0.1]:44959 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gjq4u-0007HC-Rk for importer@patchew.org; Wed, 16 Jan 2019 13:38:16 -0500 Received: from eggs.gnu.org ([209.51.188.92]:49161) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gjq0i-0004dv-JI for qemu-devel@nongnu.org; Wed, 16 Jan 2019 13:33:59 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gjq0h-0000uz-KK for qemu-devel@nongnu.org; Wed, 16 Jan 2019 13:33:56 -0500 Received: from knopi.disroot.org ([178.21.23.139]:34636) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gjq0h-0000r4-2W; Wed, 16 Jan 2019 13:33:55 -0500 Received: from localhost (localhost [127.0.0.1]) by disroot.org (Postfix) with ESMTP id DCABD222A3; Wed, 16 Jan 2019 19:33:51 +0100 (CET) Received: from knopi.disroot.org ([127.0.0.1]) by localhost (disroot.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 2YEf_th_woEC; Wed, 16 Jan 2019 19:33:50 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at disroot.org From: Nisarg Shah DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=disroot.org; s=mail; t=1547663630; bh=lvLdC18hj5zjinUEr1gcqVPf747kt1h9ImZoORQaIEw=; h=From:To:Cc:Subject:Date; b=PO/pqUUVduMKEflkoW9tkZNKRNUeWKPDQtFcsI0YUiEaHt/ACXPBhhmk3JoU/agw7 sV/aLoSiGhI98uHVrRyiBLocw/pj+WYoNAmHH2YJRBSy3X9cWBywBav6/pbNol5+PN KbqTNOblO/Y3Gd0kRBo60A+1Sc/bZnD9oLezwIC1YQMNKy0R57Mq38yPcTxJA9muK8 HaflNff+A/ZGagOmoNWrpw29+zn0RJ0XDpuJm6TAafS6O08dxvOhiphNC7AabKrNlv lebYA3jGCd3BBmQ2MEMdX/4KOwykfFzSuzdi8L4hbiHt8Pde9KzYruPzC5rsUXJi94 IIQV3+j3t7uzg== To: qemu-devel@nongnu.org Date: Thu, 17 Jan 2019 00:03:58 +0530 Message-Id: <20190116183358.30287-1-nshah@disroot.org> Mime-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 178.21.23.139 Subject: [Qemu-devel] [PATCH] device-crash-test: Convert to Python 3 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: qemu-trivial@nongnu.org, ehabkost@redhat.com, Nisarg Shah Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" 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 --- 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 + =20 import sys import os @@ -272,7 +272,7 @@ def qemuOptsEscape(s): =20 def formatTestCase(t): """Format test case info as "key=3Dvalue key=3Dvalue" for prettier log= ging output""" - return ' '.join('%s=3D%s' % (k, v) for k, v in t.items()) + return ' '.join('%s=3D%s' % (k, v) for k, v in list(t.items())) =20 =20 def qomListTypeNames(vm, **kwargs): @@ -574,7 +574,8 @@ def main(): logger.info("Skipped %d test cases", skipped) =20 if args.debug: - stats =3D sorted([(len(wl_stats.get(i, [])), wl) for i, wl in enum= erate(ERROR_WHITELIST)]) + stats =3D sorted([(len(wl_stats.get(i, [])), wl) for i, wl in + enumerate(ERROR_WHITELIST)], key=3Dlambda x: x[0]) for count, wl in stats: dbg("whitelist entry stats: %d: %r", count, wl) =20 --=20 2.19.2