From patchwork Mon Jan 5 18:30:17 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1272 Return-Path: X-Original-To: u-boot-concept@u-boot.org Delivered-To: u-boot-concept@u-boot.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1767637858; bh=NTdqgmqDdp0JGjBQnzxqaHvkjDKMOk+wMEJkYl20VM4=; h=From:To:Date:In-Reply-To:References:CC:Subject:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=sHqctZlfr2jgq/E1bmp9rin9hlE5Hscx5Rx+uo6Pj7ktRTBVgIS6mJ1OpLS3kFdlN 4NyRLZkBCVzhNOqrQUyOmbTuNRHkij9rHF9f9iCeIKBe6ySvMjGfrzndXh/FxcQ64b Cq1R5fD8zFFq6ON+fXBNW1invYD4hQThLwhsefs28w/kUF9vNpk/AaosrNkgHGrwee o4+6xwZLRHQ++Dl+TUXA7lcJAl3/YoHD86Y2P76tufXde4tdpYGnJqN1JDaWg0HyNW U+VYzYyy0aDBYYXvGSyVETWHnLYzs2g5jOPImXUcw8GDnBD5sam5wPQ4rHgcz3ewcv wOY7QE872sv7A== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 68ECD690EB for ; Mon, 5 Jan 2026 11:30:58 -0700 (MST) X-Virus-Scanned: Debian amavis at Received: from mail.u-boot.org ([127.0.0.1]) by localhost (mail.u-boot.org [127.0.0.1]) (amavis, port 10024) with ESMTP id DQGZ6_FMgEQS for ; Mon, 5 Jan 2026 11:30:58 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1767637858; bh=NTdqgmqDdp0JGjBQnzxqaHvkjDKMOk+wMEJkYl20VM4=; h=From:To:Date:In-Reply-To:References:CC:Subject:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=sHqctZlfr2jgq/E1bmp9rin9hlE5Hscx5Rx+uo6Pj7ktRTBVgIS6mJ1OpLS3kFdlN 4NyRLZkBCVzhNOqrQUyOmbTuNRHkij9rHF9f9iCeIKBe6ySvMjGfrzndXh/FxcQ64b Cq1R5fD8zFFq6ON+fXBNW1invYD4hQThLwhsefs28w/kUF9vNpk/AaosrNkgHGrwee o4+6xwZLRHQ++Dl+TUXA7lcJAl3/YoHD86Y2P76tufXde4tdpYGnJqN1JDaWg0HyNW U+VYzYyy0aDBYYXvGSyVETWHnLYzs2g5jOPImXUcw8GDnBD5sam5wPQ4rHgcz3ewcv wOY7QE872sv7A== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 557A169103 for ; Mon, 5 Jan 2026 11:30:58 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1767637856; bh=5e6P0S/7clCXeSoKydBi2+t+laMDVJk7bas2qqpwr2Y=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=k9pHuMUX+83EGxGPNnZS7FgazZz9mR50sGhQWA0lZg+bkI0CCAHBc80VrW3eRy7fE iw2DEX5j8RENhO6hWAXcnh9Auo5qsGaYUqEsMF8DiBN0EJITh+IosTtnj/lIWuTEDt uPibBbGuXuUY1dX7/ikifYtuHoEd8TrRdDu5WQceXwBALJeaA+34a0PIDgB8vmWpmW lW/2HK79vOXWI9OAPzNhY2N3Cd1p/00qC1ERCJjExQmTZa7gBS3RBPIQgpb588HPyJ nE0wOD9Des9j1vrbO5AJZPwxw+LV12aKOGl4Heu4i3iTYo+fijTvPOprggaWsnfDAz PM14tDPDwxuyw== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id A488E690EB; Mon, 5 Jan 2026 11:30:56 -0700 (MST) X-Virus-Scanned: Debian amavis at Received: from mail.u-boot.org ([127.0.0.1]) by localhost (mail.u-boot.org [127.0.0.1]) (amavis, port 10026) with ESMTP id 7tRQjOzA_Akd; Mon, 5 Jan 2026 11:30:56 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1767637852; bh=7IUOYKB5oUf4SY0Zxpw6/upUgePtAPB5MX7GH42ZqR4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=KBaoztPmYA2qSIP47kR2kKGjUL+L5BhubNnEN6ql5cEEJ39qqyoOmi3NqoaiSmyGV UkEZk21F1/p1d+Z8bJVdoLBD1CDvz56U5b1xnxFp+7ursDPU5guEywLCAeKMgfRzDh 23q56437sHRj/n8wY7vw0mPx7Zy1rVt2dEU94cI1v00Q0QFiIXPjMHpIMDbTKhF61z du0h96TMzdRFVOGExr4dTCNLZjGHgdn19PJCYTgxtObrcfSNP0KMFwPUsKQEWMFLaj uI3/ldGlpLnQPZkw2/X0T34ld7yP+5Uqd9BkRo8zMe1IcODVEx/GUzDeiNb6PlD8Ai Cd/q12r8JJrLg== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id 32C6D69045; Mon, 5 Jan 2026 11:30:52 -0700 (MST) From: Simon Glass To: U-Boot Concept Date: Mon, 5 Jan 2026 11:30:17 -0700 Message-ID: <20260105183030.1487468-3-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260105183030.1487468-1-sjg@u-boot.org> References: <20260105183030.1487468-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: RUKE5PN35WRPQUHHSGMTB4UMWVG52OSY X-Message-ID-Hash: RUKE5PN35WRPQUHHSGMTB4UMWVG52OSY X-MailFrom: sjg@u-boot.org X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: Simon Glass , "Claude Opus 4 . 5" X-Mailman-Version: 3.3.10 Precedence: list Subject: [Concept] [PATCH 02/11] buildman: Fix some pylint warnings in builderthread.py List-Id: Discussion and patches related to U-Boot Concept Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: Simon Glass Fix various pylint warnings: - Remove unused import sys - Add ValueError to raises documentation in mkdir() - Use "from err" when re-raising ValueError - Change "!= None" to "is not None" (singleton comparison) - Fix long line in run_commit() - Add pylint disable for broad-exception-caught in run() This brings builderthread.py to pylint 9.97/10 Co-developed-by: Claude Opus 4.5 Signed-off-by: Simon Glass --- tools/buildman/builderthread.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/tools/buildman/builderthread.py b/tools/buildman/builderthread.py index 0fd589934fe..1102f61ef45 100644 --- a/tools/buildman/builderthread.py +++ b/tools/buildman/builderthread.py @@ -13,7 +13,6 @@ import glob import io import os import shutil -import sys import threading from buildman import cfgutil @@ -71,6 +70,7 @@ def mkdir(dirname, parents=False): Raises: OSError: File already exists + ValueError: Trying to create the current working directory """ if not dirname or os.path.exists(dirname): return @@ -83,7 +83,8 @@ def mkdir(dirname, parents=False): if err.errno == errno.EEXIST: if os.path.realpath('.') == os.path.realpath(dirname): raise ValueError( - f"Cannot create the current working directory '{dirname}'!") + f"Cannot create the current working directory " + f"'{dirname}'!") from err else: raise @@ -464,7 +465,7 @@ class BuilderThread(threading.Thread): config_args.append(fname) else: config_args = [f'{brd.target}_defconfig'] - if fragments != None: + if fragments is not None: config_args.extend(fragments.split(',')) config_out = io.StringIO() @@ -553,7 +554,8 @@ class BuilderThread(threading.Thread): except ValueError as err: result.return_code = 10 result.stdout = '' - result.stderr = f'Tool chain error for {brd.arch}: {str(err)}' + result.stderr = (f'Tool chain error for {brd.arch}: ' + f'{str(err)}') if self.toolchain: commit = self._checkout(commit_upto, work_dir) @@ -848,7 +850,7 @@ class BuilderThread(threading.Thread): job = self.builder.queue.get() try: self.run_job(job) - except Exception as exc: + except Exception as exc: # pylint: disable=W0718 print('Thread exception (use -T0 to run without threads):', exc) self.builder.thread_exceptions.append(exc)