File tree Expand file tree Collapse file tree 1 file changed +6
-7
lines changed Expand file tree Collapse file tree 1 file changed +6
-7
lines changed Original file line number Diff line number Diff line change @@ -165,14 +165,13 @@ def detect_extension_modules(args: argparse.Namespace):
165
165
loc = {}
166
166
exec (data , globals (), loc )
167
167
168
- for name , value in loc ["build_time_vars" ].items ():
169
- if value not in { "yes" , "missing" , "disabled" , "n/a" } :
168
+ for key , value in loc ["build_time_vars" ].items ():
169
+ if not key . startswith ( "MODULE_" ) or not key . endswith ( "_STATE" ) :
170
170
continue
171
- if not name .startswith ("MODULE_" ):
172
- continue
173
- if name .endswith (("_CFLAGS" , "_DEPS" , "_LDFLAGS" )):
174
- continue
175
- modname = name .removeprefix ("MODULE_" ).lower ()
171
+ if value not in {"yes" , "disabled" , "missing" , "n/a" }:
172
+ raise ValueError (f"Unsupported value '{ value } ' for { key } " )
173
+
174
+ modname = key [7 :- 6 ].lower ()
176
175
if modname not in modules :
177
176
modules [modname ] = value == "yes"
178
177
return modules
You can’t perform that action at this time.
0 commit comments