mirror of
https://github.com/raspberrypi/linux.git
synced 2025-12-07 02:19:54 +00:00
scripts/lib/kdoc/kdoc_parser.py: fix Python compat with < v3.13
- 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 <mchehab+huawei@kernel.org> Signed-off-by: Jonathan Corbet <corbet@lwn.net> Link: https://lore.kernel.org/r/e2b8e8361294558dae09236e4b8fbea5d86be5a3.1744106242.git.mchehab+huawei@kernel.org
This commit is contained in:
committed by
Jonathan Corbet
parent
485f6f7960
commit
78ea748f79
@@ -1444,9 +1444,9 @@ class KernelDoc:
|
||||
|
||||
r = Re(r'long\s+(sys_.*?),')
|
||||
if r.search(proto):
|
||||
proto = proto.replace(',', '(', count=1)
|
||||
proto = Re(',').sub('(', proto, count=1)
|
||||
elif is_void:
|
||||
proto = proto.replace(')', '(void)', count=1)
|
||||
proto = Re(r'\)').sub('(void)', proto, count=1)
|
||||
|
||||
# Now delete all of the odd-numbered commas in the proto
|
||||
# so that argument types & names don't have a comma between them
|
||||
|
||||
Reference in New Issue
Block a user