diff options
Diffstat (limited to 'Tools/wasm/wasm_assets.py')
-rwxr-xr-x | Tools/wasm/wasm_assets.py | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/Tools/wasm/wasm_assets.py b/Tools/wasm/wasm_assets.py index 695e6ff..a300d59 100755 --- a/Tools/wasm/wasm_assets.py +++ b/Tools/wasm/wasm_assets.py @@ -108,6 +108,14 @@ OMIT_MODULE_FILES = { "_zoneinfo": ["zoneinfo/"], } +SYSCONFIG_NAMES = ( + "_sysconfigdata__emscripten_wasm32-emscripten", + "_sysconfigdata__emscripten_wasm32-emscripten", + "_sysconfigdata__wasi_wasm32-wasi", + "_sysconfigdata__wasi_wasm64-wasi", +) + + def get_builddir(args: argparse.Namespace) -> pathlib.Path: """Get builddir path from pybuilddir.txt """ @@ -120,7 +128,11 @@ def get_sysconfigdata(args: argparse.Namespace) -> pathlib.Path: """Get path to sysconfigdata relative to build root """ data_name = sysconfig._get_sysconfigdata_name() - assert "emscripten_wasm32" in data_name + if not data_name.startswith(SYSCONFIG_NAMES): + raise ValueError( + f"Invalid sysconfig data name '{data_name}'.", + SYSCONFIG_NAMES + ) filename = data_name + ".py" return args.builddir / filename |