]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
scripts/lib/kdoc/kdoc_parser.py: remove a python 3.9 dependency
authorMauro Carvalho Chehab <mchehab+huawei@kernel.org>
Tue, 8 Apr 2025 10:09:30 +0000 (18:09 +0800)
committerJonathan Corbet <corbet@lwn.net>
Wed, 9 Apr 2025 18:10:34 +0000 (12:10 -0600)
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
scripts/lib/kdoc/kdoc_parser.py

index f923600561f83bc97d0572bd1c44b117eb4aafa8..77e8bfeccc8ede6291f283a7f84fee4c362e3956 100755 (executable)
@@ -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: