From nobody Sun Feb 8 17:22:31 2026 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id ED34224A07C; Mon, 24 Feb 2025 09:09:03 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1740388144; cv=none; b=CZX60vt8pBFZfSvCwenp+J/mw5nuLwftHTRu76Zvm+m9DxK+TBUV8pSZ+Q6qMWVqnJ2R6Tr8XD9FeWZqL1yQHI06ebBhT3ZUS9+W+KbLdDq741dkoXOFbJVX9hruJ2c/bjsOvI1rV9gIT/tkCivtMyAUQLltJ0bb4Y5YeRtitoQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1740388144; c=relaxed/simple; bh=cgbg7nED/bJ/uBnZ2iDb/1x2SRXvvmDXvNCZuMR+Pis=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=F73Y15F1RdyIB6l6+Xtd03g+BHLatsqRDTOTHyBghsMN5gLp08mLQa0vAyrrTCA8WgiHdagL7mlL/Lq77rFo2FpspkcJS9OlaDEZ01c7P/XnT1s/8WEgjzH0YBDh+yaFo5T76p0eAqx94QpiePpNsxoN79dlsSe5jzBeNVtEETg= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=k4muGANG; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="k4muGANG" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 767B6C4CEE8; Mon, 24 Feb 2025 09:09:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1740388143; bh=cgbg7nED/bJ/uBnZ2iDb/1x2SRXvvmDXvNCZuMR+Pis=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=k4muGANGC+6eAxs7YsqmhiQm/1Fdsp31mLBuKUKpr0iPfmw5ADIM/bHMBYPUyIaza lkqplnqjVgih4Bq0YsZSEn9UTBEkRyLnR+ZDd/VtTpfE9pdt/PP0BN0ULYPfkodDVZ pW3xb4u2vF1vqqbm4CzTMIg5oUglwTr9+CNKoejDqyu8Na4kZApCgqROgGRMYCbxTW e3B+JsBGmv6FwaDKHvQvpqhoXNQoTcKLJiG85VXHxj4GrCb2yESe8AUBuA3bjGGjDY tog2yhGv03C3FTlkb2upjK3bMr/9ASsQFT6lw0MyLqhVmr8sMeCebYYHavhOtsix8y vjSAlQ7n24JDA== Received: from mchehab by mail.kernel.org with local (Exim 4.98) (envelope-from ) id 1tmUST-00000003p5N-2Ws9; Mon, 24 Feb 2025 10:09:01 +0100 From: Mauro Carvalho Chehab To: Linux Doc Mailing List , Jonathan Corbet Cc: Mauro Carvalho Chehab , "Mauro Carvalho Chehab" , linux-kernel@vger.kernel.org Subject: [PATCH v2 30/39] scripts/lib/kdoc/kdoc_parser.py: fix Python compat with < v3.13 Date: Mon, 24 Feb 2025 10:08:36 +0100 Message-ID: X-Mailer: git-send-email 2.48.1 In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Sender: Mauro Carvalho Chehab Content-Type: text/plain; charset="utf-8" - str.replace count was introduced only in Python 3.13; - before Python 3.13, f-string dict arguments can't use the same delimiter of the main string. Signed-off-by: Mauro Carvalho Chehab --- scripts/lib/kdoc/kdoc_output.py | 8 ++++---- scripts/lib/kdoc/kdoc_parser.py | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/scripts/lib/kdoc/kdoc_output.py b/scripts/lib/kdoc/kdoc_output= .py index 97ec671e0b6e..df3c15bb1c10 100755 --- a/scripts/lib/kdoc/kdoc_output.py +++ b/scripts/lib/kdoc/kdoc_output.py @@ -645,16 +645,16 @@ class ManFormat(OutputFormat): sectionlist =3D args.get('sectionlist', []) sections =3D args.get('sections', {}) =20 - self.data +=3D f'.TH "{args['function']}" 9 "{args['function']}" "= {self.man_date}" "Kernel Hacker\'s Manual" LINUX' + "\n" + self.data +=3D f'.TH "{args["function"]}" 9 "{args["function"]}" "= {self.man_date}" "Kernel Hacker\'s Manual" LINUX' + "\n" =20 self.data +=3D ".SH NAME\n" self.data +=3D f"{args['function']} \\- {args['purpose']}\n" =20 self.data +=3D ".SH SYNOPSIS\n" if args.get('functiontype', ''): - self.data +=3D f'.B "{args['functiontype']}" {args['function']= }' + "\n" + self.data +=3D f'.B "{args["functiontype"]}" {args["function"]= }' + "\n" else: - self.data +=3D f'.B "{args['function']}' + "\n" + self.data +=3D f'.B "{args["function"]}' + "\n" =20 count =3D 0 parenth =3D "(" @@ -695,7 +695,7 @@ class ManFormat(OutputFormat): sectionlist =3D args.get('sectionlist', []) sections =3D args.get('sections', {}) =20 - self.data +=3D f'.TH "{args['module']}" 9 "enum {args['enum']}" "{= self.man_date}" "API Manual" LINUX' + "\n" + self.data +=3D f'.TH "{args["module"]}" 9 "enum {args["enum"]}" "{= self.man_date}" "API Manual" LINUX' + "\n" =20 self.data +=3D ".SH NAME\n" self.data +=3D f"enum {args['enum']} \\- {args['purpose']}\n" diff --git a/scripts/lib/kdoc/kdoc_parser.py b/scripts/lib/kdoc/kdoc_parser= .py index a71145d531f2..51ac2d69a587 100755 --- a/scripts/lib/kdoc/kdoc_parser.py +++ b/scripts/lib/kdoc/kdoc_parser.py @@ -1455,9 +1455,9 @@ class KernelDoc: =20 r =3D Re(r'long\s+(sys_.*?),') if r.search(proto): - proto =3D proto.replace(',', '(', count=3D1) + proto =3D Re(',').sub('(', proto, count=3D1) elif is_void: - proto =3D proto.replace(')', '(void)', count=3D1) + proto =3D Re(r'\)').sub('(void)', proto, count=3D1) =20 # Now delete all of the odd-numbered commas in the proto # so that argument types & names don't have a comma between them --=20 2.48.1