Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 15317C433EF for ; Mon, 18 Oct 2021 19:58:40 +0000 (UTC) Received: from smtp2.osuosl.org (smtp2.osuosl.org [140.211.166.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 8FC78610C7 for ; Mon, 18 Oct 2021 19:58:39 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 8FC78610C7 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=mind.be Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=buildroot.org Received: from localhost (localhost [127.0.0.1]) by smtp2.osuosl.org (Postfix) with ESMTP id 5FABA40164; Mon, 18 Oct 2021 19:58:39 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp2.osuosl.org ([127.0.0.1]) by localhost (smtp2.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id nKKkpHhQX8O7; Mon, 18 Oct 2021 19:58:38 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by smtp2.osuosl.org (Postfix) with ESMTP id 4FF854046F; Mon, 18 Oct 2021 19:58:37 +0000 (UTC) Received: from smtp2.osuosl.org (smtp2.osuosl.org [140.211.166.133]) by ash.osuosl.org (Postfix) with ESMTP id A05F31BF350 for ; Mon, 18 Oct 2021 19:58:35 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp2.osuosl.org (Postfix) with ESMTP id 8F8364046F for ; Mon, 18 Oct 2021 19:58:35 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp2.osuosl.org ([127.0.0.1]) by localhost (smtp2.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id tusepEOwUSFC for ; Mon, 18 Oct 2021 19:58:34 +0000 (UTC) X-Greylist: whitelisted by SQLgrey-1.8.0 Received: from mail-ed1-x536.google.com (mail-ed1-x536.google.com [IPv6:2a00:1450:4864:20::536]) by smtp2.osuosl.org (Postfix) with ESMTPS id 0BC1C40164 for ; Mon, 18 Oct 2021 19:58:33 +0000 (UTC) Received: by mail-ed1-x536.google.com with SMTP id a25so3619801edx.8 for ; Mon, 18 Oct 2021 12:58:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mind.be; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=EZAwl29ZjoLx+06FfSc7zMUmDYuV1hW6FDdiGl4qfQ8=; b=hNWIke+dSyF1e0c7jLDYDlHeWvvjnIJ725/yy3nagK4fqvA6scqHVGGlL3rOqgFTgL puC1VwwbPkVMmqA/zwsmm6SJFPIF6yR1FANTulYqi8O75YCMWpWM4/IfnPe5RaOmNweY uuYGo6X6jXxLojyskAPyynXR14Ylmx8JB36O0++bPDPMxwRIAVNAKYexWCQz907hD+EJ z1Thm7pSFBV+OC9/gSyiE8annNnP1TgfKK22KlzthPJ9+8dZc41ZNsjOdFLfCjfd+FUc bPC6RMOt3KFo/qYL3zUZ6b7p/wJAo08/ANi3lN//6MuOiebiMj7HLvDl7ZKAlNWRb7nX OoUA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=EZAwl29ZjoLx+06FfSc7zMUmDYuV1hW6FDdiGl4qfQ8=; b=uZuJYnG99TXMf9s/6bvWwS63d1K0S/0OWsQWCGWMpsd5Q+YD8RFHo3n94gNFIHfNaE 9l1CP5q+39Z1S3+WyzKfMHAY2CQ4b4rB2J5OTEJB1weriP0E6QgDi/nG6zogZDYohrw/ 7qYFAakuuF2oRWiBMl9V82ZRFRaKmkB6rVSG6BZxTqxT/WZO8M9a3lhUcmtbABmltWHF KC7UKlEBEoTD8fjqTaNmBzJuGWPlMZgNOBXAyHo33F5+ftqwyMgu29VB23NzUSnbBUzE S2bjhbfLwxRKYGA04RrYaq2WJHYE2l7nA2crI793NeXDT7Cg+WwESqbExj0Ycv6mqBHY Qv2w== X-Gm-Message-State: AOAM530YPtFd0HseKaxhgktK4sdZUBLMLEDbjlRwG6AWd21ghfhKL+4K yNZ4bB3f7iqkU68/WmHJgayfMxQxA1oW09QP X-Google-Smtp-Source: ABdhPJxKcLfEol04vP/ubC+I5FBCz54Arqc/xvhHa3RInt/QSx1VeGH9UqPMTUHrSvI4sr3GTM+TiQ== X-Received: by 2002:a17:907:7848:: with SMTP id lb8mr31622120ejc.494.1634587112183; Mon, 18 Oct 2021 12:58:32 -0700 (PDT) Received: from localhost.localdomain (ptr-9fplejn4os7m3x31ny9.18120a2.ip6.access.telenet.be. [2a02:1811:3a7e:7b00:1400:24ea:cbca:e681]) by smtp.gmail.com with ESMTPSA id d30sm10463916edn.49.2021.10.18.12.58.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 18 Oct 2021 12:58:31 -0700 (PDT) From: "Arnout Vandecappelle (Essensium/Mind)" To: buildroot@buildroot.org Date: Mon, 18 Oct 2021 21:58:22 +0200 Message-Id: <20211018195822.2263226-2-arnout@mind.be> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20211018195822.2263226-1-arnout@mind.be> References: <20211018195822.2263226-1-arnout@mind.be> MIME-Version: 1.0 Subject: [Buildroot] [PATCH 2/2] treewide: fix flake8 error E741 ambiguous variable name X-BeenThere: buildroot@buildroot.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: buildroot-bounces@buildroot.org Sender: "buildroot" A recent update of flake8 in CI introduced a new check E741. It basically checks that variables are at least 3 characters long. Up to now, however, we have used shorter names in some places - all of them turn out to be "l" for a line of text. Replace all those "l" variables with "line". Fixes: https://gitlab.com/buildroot.org/buildroot/-/jobs/1687009829 partially: support/scripts/boot-qemu-image.py:47:21: E741 ambiguous variable name 'l' support/scripts/check-dotconfig.py:20:38: E741 ambiguous variable name 'l' support/scripts/size-stats:76:13: E741 ambiguous variable name 'l' support/testing/tests/core/test_bad_arch.py:17:32: E741 ambiguous variable name 'l' support/testing/tests/package/test_python_treq.py:10:30: E741 ambiguous variable name 'l' support/testing/tests/toolchain/test_external.py:30:42: E741 ambiguous variable name 'l' Signed-off-by: Arnout Vandecappelle (Essensium/Mind) --- support/scripts/boot-qemu-image.py | 6 +++--- support/scripts/check-dotconfig.py | 2 +- support/scripts/size-stats | 4 ++-- support/testing/tests/core/test_bad_arch.py | 2 +- support/testing/tests/package/test_python_treq.py | 2 +- support/testing/tests/toolchain/test_external.py | 2 +- 6 files changed, 9 insertions(+), 9 deletions(-) diff --git a/support/scripts/boot-qemu-image.py b/support/scripts/boot-qemu-image.py index 0d4ad825fc..fba1533bb7 100755 --- a/support/scripts/boot-qemu-image.py +++ b/support/scripts/boot-qemu-image.py @@ -43,9 +43,9 @@ def main(): # In this case, spawn above will succeed at starting the wrapper # start-qemu.sh, but that one will fail (exit with 127) in such # a situation. - exit = [int(l.split(' ')[1]) - for l in e.value.splitlines() - if l.startswith('exitstatus: ')] + exit = [int(line.split(' ')[1]) + for line in e.value.splitlines() + if line.startswith('exitstatus: ')] if len(exit) and exit[0] == 127: print('qemu-start.sh could not find the qemu binary') sys.exit(0) diff --git a/support/scripts/check-dotconfig.py b/support/scripts/check-dotconfig.py index f9a416b743..54fd6ae91e 100755 --- a/support/scripts/check-dotconfig.py +++ b/support/scripts/check-dotconfig.py @@ -17,7 +17,7 @@ def main(): # strip() to get rid of trailing \n with open(configfile) as configf: - configlines = [l.strip() for l in configf.readlines()] + configlines = [line.strip() for line in configf.readlines()] defconfiglines = [] with open(defconfig) as defconfigf: diff --git a/support/scripts/size-stats b/support/scripts/size-stats index bf3d12a9b7..e4389e99b5 100755 --- a/support/scripts/size-stats +++ b/support/scripts/size-stats @@ -73,8 +73,8 @@ def add_file(filesdict, relpath, abspath, pkg): def build_package_dict(builddir): filesdict = {} with open(os.path.join(builddir, "build", "packages-file-list.txt")) as f: - for l in f.readlines(): - pkg, fpath = l.split(",", 1) + for line in f.readlines(): + pkg, fpath = line.split(",", 1) # remove the initial './' in each file path fpath = fpath.strip()[2:] fullpath = os.path.join(builddir, "target", fpath) diff --git a/support/testing/tests/core/test_bad_arch.py b/support/testing/tests/core/test_bad_arch.py index 316231e28e..c96a7152af 100644 --- a/support/testing/tests/core/test_bad_arch.py +++ b/support/testing/tests/core/test_bad_arch.py @@ -14,5 +14,5 @@ class DetectBadArchTest(infra.basetest.BRConfigTest): if logf_path: s = 'ERROR: architecture for "/usr/bin/foo" is' with open(logf_path, "r") as f: - lines = [l for l in f.readlines() if l.startswith(s)] + lines = [line for line in f.readlines() if line.startswith(s)] self.assertEqual(len(lines), 1) diff --git a/support/testing/tests/package/test_python_treq.py b/support/testing/tests/package/test_python_treq.py index d7a23829ea..307c9932b2 100644 --- a/support/testing/tests/package/test_python_treq.py +++ b/support/testing/tests/package/test_python_treq.py @@ -7,7 +7,7 @@ class TestPythonTreq(TestPythonPackageBase): def run_sample_scripts(self): cmd = self.interpreter + " sample_python_treq.py" output, exit_code = self.emulator.run(cmd, timeout=20) - refuse_msgs = [1 for l in output if "Connection refused" in l] + refuse_msgs = [1 for line in output if "Connection refused" in line] self.assertGreater(sum(refuse_msgs), 0) self.assertEqual(exit_code, 0) diff --git a/support/testing/tests/toolchain/test_external.py b/support/testing/tests/toolchain/test_external.py index db62a84391..d22f38cedc 100644 --- a/support/testing/tests/toolchain/test_external.py +++ b/support/testing/tests/toolchain/test_external.py @@ -27,7 +27,7 @@ class TestExternalToolchain(infra.basetest.BRTest): self.assertFalse(has_broken_links(path)) with open(os.path.join(self.builddir, ".config"), 'r') as configf: - configlines = [l.strip() for l in configf.readlines()] + configlines = [line.strip() for line in configf.readlines()] if "BR2_BINFMT_ELF=y" in configlines: interp = infra.get_elf_prog_interpreter(self.builddir, -- 2.31.1 _______________________________________________ buildroot mailing list buildroot@buildroot.org https://lists.buildroot.org/mailman/listinfo/buildroot