summaryrefslogtreecommitdiffstats
path: root/Tools/wasm
diff options
context:
space:
mode:
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>2022-07-20 07:17:52 (GMT)
committerGitHub <noreply@github.com>2022-07-20 07:17:52 (GMT)
commite98728ab4d4ab9e69ce05ae4da4031bbc80f457b (patch)
treec70fdcf9529f5623836e2ff65f31472c311b057e /Tools/wasm
parent84d58ad17baec0dda8a5ffd8d925343391e45b3e (diff)
downloadcpython-e98728ab4d4ab9e69ce05ae4da4031bbc80f457b.zip
cpython-e98728ab4d4ab9e69ce05ae4da4031bbc80f457b.tar.gz
cpython-e98728ab4d4ab9e69ce05ae4da4031bbc80f457b.tar.bz2
gh-93939: Use new MODULE_name_STATE in wasm_assets script (GH-95035)
(cherry picked from commit 0f34c7e2d3163525813dbd644f30db58e6d36af2) Co-authored-by: Christian Heimes <christian@python.org>
Diffstat (limited to 'Tools/wasm')
-rwxr-xr-xTools/wasm/wasm_assets.py13
1 files changed, 6 insertions, 7 deletions
diff --git a/Tools/wasm/wasm_assets.py b/Tools/wasm/wasm_assets.py
index b7e8351..40acea2 100755
--- a/Tools/wasm/wasm_assets.py
+++ b/Tools/wasm/wasm_assets.py
@@ -175,14 +175,13 @@ def detect_extension_modules(args: argparse.Namespace):
loc = {}
exec(data, globals(), loc)
- for name, value in loc["build_time_vars"].items():
- if value not in {"yes", "missing", "disabled", "n/a"}:
+ for key, value in loc["build_time_vars"].items():
+ if not key.startswith("MODULE_") or not key.endswith("_STATE"):
continue
- if not name.startswith("MODULE_"):
- continue
- if name.endswith(("_CFLAGS", "_DEPS", "_LDFLAGS")):
- continue
- modname = name.removeprefix("MODULE_").lower()
+ if value not in {"yes", "disabled", "missing", "n/a"}:
+ raise ValueError(f"Unsupported value '{value}' for {key}")
+
+ modname = key[7:-6].lower()
if modname not in modules:
modules[modname] = value == "yes"
return modules