8000 gh-93939: Use new MODULE_name_STATE in wasm_assets script (GH-95035) · python/cpython@e98728a · GitHub
[go: up one dir, main page]

Skip to content

Commit e98728a

Browse files
gh-93939: Use new MODULE_name_STATE in wasm_assets script (GH-95035)
(cherry picked from commit 0f34c7e) Co-authored-by: Christian Heimes <christian@python.org>
1 parent 84d58ad commit e98728a

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

Tools/wasm/wasm_assets.py

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -175,14 +175,13 @@ def detect_extension_modules(args: argparse.Namespace):
175175
loc = {}
176176
exec(data, globals(), loc)
177177

178-
for name, value in loc["build_time_vars"].items():
179-
if value not in {"yes", "missing", "disabled", "n/a"}:
178+
for key, value in loc["build_time_vars"].items():
179+
if not key.startswith("MODULE_") or not key.endswith("_STATE"):
180180
continue
181-
if not name.startswith("MODULE_"):
182-
continue
183-
if name.endswith(("_CFLAGS", "_DEPS", "_LDFLAGS")):
184-
continue
185-
modname = name.removeprefix("MODULE_").lower()
181+
if value not in {"yes", "disabled", "missing", "n/a"}:
182+
raise ValueError(f"Unsupported value '{value}' for {key}")
183+
184+
modname = key[7:-6].lower()
186185
if modname not in modules:
187186
modules[modname] = value == "yes"
188187
return modules

0 commit comments

Comments
 (0)
0