]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
Revert "generate-bpf-delegate-configs: fix compatibility with Python 3.7"
authorYu Watanabe <watanabe.yu+github@gmail.com>
Tue, 17 Feb 2026 11:33:54 +0000 (20:33 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Wed, 18 Feb 2026 09:47:15 +0000 (18:47 +0900)
This reverts commit dee77ac201741709b2323cae73aeeaff60fd8521.

Now we require Python 3.9 or newer.

src/core/generate-bpf-delegate-configs.py

index 4444282b4b536637a13b51e2379c965e0444aac7..200c913b8a8264d976a88cfc6ea073f24ae036c0 100755 (executable)
@@ -7,7 +7,6 @@
 
 import re
 import sys
-import typing
 
 
 def print_usage_and_exit() -> None:
@@ -27,7 +26,7 @@ if output not in ['code', 'doc']:
 
 with open(header) as file:
     inEnum = False
-    enumValues: typing.List[str] = []
+    enumValues: list[str] = []
     enumName = ''
 
     if output == 'doc':
@@ -68,12 +67,10 @@ with open(header) as file:
                 match = re.fullmatch(r'(\w+)\b,', line)
                 if match and len(match.groups()) > 0 and not match[1].startswith('__'):
                     enumValues.append(match[1])
-        else:
-            match = re.match(r'^\s*enum\s+bpf_(cmd|map_type|prog_type|attach_type)+\s*{', line)
-            if match:
-                # Start of a new enum
-                inEnum = True
-                enumName = 'bpf_delegate_' + match[1]
+        elif match := re.match(r'^\s*enum\s+bpf_(cmd|map_type|prog_type|attach_type)+\s*{', line):
+            # Start of a new enum
+            inEnum = True
+            enumName = 'bpf_delegate_' + match[1]
 
     if output == 'doc':
         print('</para>')