scripts/lib/kdoc/kdoc_parser.py: remove a python 3.9 dependency

str.removesuffix() was added on Python 3.9, but rstrip()
actually does the same thing, as we just want to remove a single
character. It is also shorter.

So, use it.

Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Signed-off-by: Jonathan Corbet <corbet@lwn.net>
Link: https://lore.kernel.org/r/f64cc4adef107ada26da4bfb7e4b7002dd783173.1744106242.git.mchehab+huawei@kernel.org
This commit is contained in:
Mauro Carvalho Chehab 2025-04-08 18:09:30 +08:00 committed by Jonathan Corbet
parent 91d00bd54f
commit e4b2bd908c
1 changed files with 1 additions and 1 deletions

View File

@ -1641,7 +1641,7 @@ class KernelDoc:
# Group continuation lines on prototypes
if self.state == self.STATE_PROTO:
if line.endswith("\\"):
prev += line.removesuffix("\\")
prev += line.rstrip("\\")
cont = True
if not prev_ln: