From nobody Mon Nov 3 06:16:35 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 152846120813193.82327896680772; Fri, 8 Jun 2018 05:33:28 -0700 (PDT) Received: from localhost ([::1]:35340 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fRGa7-0000iF-7o for importer@patchew.org; Fri, 08 Jun 2018 08:33:27 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:45598) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fRGXp-0007z6-NE for qemu-devel@nongnu.org; Fri, 08 Jun 2018 08:31:06 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fRGXo-000505-Si for qemu-devel@nongnu.org; Fri, 08 Jun 2018 08:31:05 -0400 Received: from mx1.redhat.com ([209.132.183.28]:39430) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1fRGXm-0004yN-KP; Fri, 08 Jun 2018 08:31:02 -0400 Received: from smtp.corp.redhat.com (int-mx12.intmail.prod.int.phx2.redhat.com [10.5.11.27]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id BAD933086249; Fri, 8 Jun 2018 12:31:01 +0000 (UTC) Received: from localhost (ovpn-116-19.gru2.redhat.com [10.97.116.19]) by smtp.corp.redhat.com (Postfix) with ESMTP id 2726FB1A19; Fri, 8 Jun 2018 12:31:00 +0000 (UTC) From: Eduardo Habkost To: qemu-devel@nongnu.org Date: Fri, 8 Jun 2018 09:29:45 -0300 Message-Id: <20180608122952.2009-4-ehabkost@redhat.com> In-Reply-To: <20180608122952.2009-1-ehabkost@redhat.com> References: <20180608122952.2009-1-ehabkost@redhat.com> X-Scanned-By: MIMEDefang 2.84 on 10.5.11.27 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.49]); Fri, 08 Jun 2018 12:31:01 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH v2 03/10] python: futurize -f libfuturize.fixes.fix_next_call 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: Kevin Wolf , Fam Zheng , Eduardo Habkost , qemu-block@nongnu.org, Juan Quintela , Markus Armbruster , "Dr. David Alan Gilbert" , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Stefan Hajnoczi , Cleber Rosa , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , Max Reitz , =?UTF-8?q?Alex=20Benn=C3=A9e?= Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Change obj.next() calls to next(obj). This is necessary for Python 3 compatibility. Done using: $ py=3D$( (g grep -l -E '^#!.*python';find -name '*.py' -printf '%P\n';) = | \ sort -u | grep -v README.sh4) $ futurize -w -f libfuturize.fixes.fix_next_call $py Reviewed-by: Stefan Hajnoczi Signed-off-by: Eduardo Habkost --- scripts/ordereddict.py | 4 ++-- scripts/vmstate-static-checker.py | 4 ++-- tests/image-fuzzer/runner.py | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/scripts/ordereddict.py b/scripts/ordereddict.py index 2d1d81370b..68ed340b33 100644 --- a/scripts/ordereddict.py +++ b/scripts/ordereddict.py @@ -71,9 +71,9 @@ class OrderedDict(dict, DictMixin): if not self: raise KeyError('dictionary is empty') if last: - key =3D reversed(self).next() + key =3D next(reversed(self)) else: - key =3D iter(self).next() + key =3D next(iter(self)) value =3D self.pop(key) return key, value =20 diff --git a/scripts/vmstate-static-checker.py b/scripts/vmstate-static-che= cker.py index 60d1bf4cda..d3467288dc 100755 --- a/scripts/vmstate-static-checker.py +++ b/scripts/vmstate-static-checker.py @@ -158,7 +158,7 @@ def check_fields(src_fields, dest_fields, desc, sec): while True: if advance_src: try: - s_item =3D s_iter.next() + s_item =3D next(s_iter) except StopIteration: if s_iter_list =3D=3D []: break @@ -173,7 +173,7 @@ def check_fields(src_fields, dest_fields, desc, sec): =20 if advance_dest: try: - d_item =3D d_iter.next() + d_item =3D next(d_iter) except StopIteration: if d_iter_list =3D=3D []: # We were not in a substruct diff --git a/tests/image-fuzzer/runner.py b/tests/image-fuzzer/runner.py index 8de656933e..45e8fca63f 100755 --- a/tests/image-fuzzer/runner.py +++ b/tests/image-fuzzer/runner.py @@ -422,7 +422,7 @@ if __name__ =3D=3D '__main__': test_id =3D count(1) while should_continue(duration, start_time): try: - run_test(str(test_id.next()), seed, work_dir, run_log, cleanup, + run_test(str(next(test_id)), seed, work_dir, run_log, cleanup, log_all, command, config) except (KeyboardInterrupt, SystemExit): sys.exit(1) --=20 2.18.0.rc1.1.g3f1ff2140