From patchwork Sat May 27 21:58:46 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Luca Ceresoli X-Patchwork-Id: 767779 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3wZxjQ2c9Zz9s75 for ; Sun, 28 May 2017 07:59:05 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id F1430879F7; Sat, 27 May 2017 21:59:02 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from fraxinus.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id KUw2Cme4tHID; Sat, 27 May 2017 21:59:01 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by fraxinus.osuosl.org (Postfix) with ESMTP id 1DCD1879D7; Sat, 27 May 2017 21:59:01 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136]) by ash.osuosl.org (Postfix) with ESMTP id 3674D1C0415 for ; Sat, 27 May 2017 21:59:00 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id 2007B238FA for ; Sat, 27 May 2017 21:59:00 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from silver.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id oxKzBubaaD98 for ; Sat, 27 May 2017 21:58:59 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from srv-hp10-72.netsons.net (srv-hp10-72.netsons.net [94.141.22.72]) by silver.osuosl.org (Postfix) with ESMTPS id F06A1236F4 for ; Sat, 27 May 2017 21:58:58 +0000 (UTC) Received: from 78-134-18-77.v4.ngi.it ([78.134.18.77]:50544 helo=localhost.localdomain) by srv-hp10.netsons.net with esmtpa (Exim 4.89) (envelope-from ) id 1dEjjc-002CE2-2S; Sat, 27 May 2017 23:58:56 +0200 From: Luca Ceresoli To: buildroot@buildroot.org Date: Sat, 27 May 2017 23:58:46 +0200 Message-Id: <1495922327-16174-1-git-send-email-luca@lucaceresoli.net> X-Mailer: git-send-email 2.7.4 X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - srv-hp10.netsons.net X-AntiAbuse: Original Domain - buildroot.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - lucaceresoli.net X-Get-Message-Sender-Via: srv-hp10.netsons.net: authenticated_id: luca+lucaceresoli.net/only user confirmed/virtual account not confirmed X-Authenticated-Sender: srv-hp10.netsons.net: luca@lucaceresoli.net X-Source: X-Source-Args: X-Source-Dir: Cc: Luca Ceresoli Subject: [Buildroot] [PATH 1/2] support/testing: rename variables for readability X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" The 'lines' variable is overwritten with its own fields. Thus it contains a line first, and then a list of fields -- it never contains 'lines'. Use two different variables named 'line' and 'fields' to make the code more readable. Signed-off-by: Luca Ceresoli Acked-by: Ricardo Martincoski --- support/testing/tests/fs/test_ext.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/support/testing/tests/fs/test_ext.py b/support/testing/tests/fs/test_ext.py index f7e2e85055e1..d35eea8bb5fa 100644 --- a/support/testing/tests/fs/test_ext.py +++ b/support/testing/tests/fs/test_ext.py @@ -21,10 +21,10 @@ def dumpe2fs_run(builddir, image): return ret.strip().splitlines() def dumpe2fs_getprop(out, prop): - for lines in out: - lines = lines.split(": ") - if lines[0] == prop: - return lines[1].strip() + for line in out: + fields = line.split(": ") + if fields[0] == prop: + return fields[1].strip() def boot_img_and_check_fs_type(emulator, builddir, fs_type): img = os.path.join(builddir, "images", "rootfs.{}".format(fs_type))