summaryrefslogtreecommitdiff
path: root/Python/sysmodule.c
diff options
context:
space:
mode:
authorChristian Heimes <christian@python.org>2022-09-13 12:06:39 +0200
committerGitHub <noreply@github.com>2022-09-13 12:06:39 +0200
commit4958820032d547cf7a1ebd619460d778ec143f9c (patch)
treec815e5ef7fc33c15f794534ced51d72616cf6844 /Python/sysmodule.c
parent390123b412346eb4438665f068bb73226ac84e7c (diff)
downloadpython-4958820032d547cf7a1ebd619460d778ec143f9c.tar.gz
python-4958820032d547cf7a1ebd619460d778ec143f9c.zip
[3.11] gh-95853: Add script to automate WASM build (GH-95828, GH-95985, GH-96045, GH-96389, GH-96744) (GH-96749)
Automate WASM build with a new Python script. The script provides several build profiles with configure flags for Emscripten flavors and WASI. The script can detect and use Emscripten SDK and WASI SDK from default locations or env vars. ``configure`` now detects Node arguments and creates HOSTRUNNER arguments for Node 16. It also sets correct arguments for ``wasm64-emscripten``.
Diffstat (limited to 'Python/sysmodule.c')
-rw-r--r--Python/sysmodule.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/Python/sysmodule.c b/Python/sysmodule.c
index dca97f21a2d..6f703e30050 100644
--- a/Python/sysmodule.c
+++ b/Python/sysmodule.c
@@ -2775,14 +2775,18 @@ EM_JS(char *, _Py_emscripten_runtime, (void), {
if (typeof navigator == 'object') {
info = navigator.userAgent;
} else if (typeof process == 'object') {
- info = "Node.js ".concat(process.version)
+ info = "Node.js ".concat(process.version);
} else {
- info = "UNKNOWN"
+ info = "UNKNOWN";
}
var len = lengthBytesUTF8(info) + 1;
var res = _malloc(len);
- stringToUTF8(info, res, len);
+ if (res) stringToUTF8(info, res, len);
+#if __wasm64__
+ return BigInt(res);
+#else
return res;
+#endif
});
static PyObject *