summaryrefslogtreecommitdiffstats
path: root/Python/sysmodule.c
diff options
context:
space:
mode:
authorChristian Heimes <christian@python.org>2022-09-13 10:06:39 (GMT)
committerGitHub <noreply@github.com>2022-09-13 10:06:39 (GMT)
commit4958820032d547cf7a1ebd619460d778ec143f9c (patch)
treec815e5ef7fc33c15f794534ced51d72616cf6844 /Python/sysmodule.c
parent390123b412346eb4438665f068bb73226ac84e7c (diff)
downloadcpython-4958820032d547cf7a1ebd619460d778ec143f9c.zip
cpython-4958820032d547cf7a1ebd619460d778ec143f9c.tar.gz
cpython-4958820032d547cf7a1ebd619460d778ec143f9c.tar.bz2
[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 dca97f2..6f703e3 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 *