summaryrefslogtreecommitdiffstats
path: root/Python/sysmodule.c
diff options
context:
space:
mode:
authorChristian Heimes <christian@python.org>2022-08-13 19:56:08 (GMT)
committerGitHub <noreply@github.com>2022-08-13 19:56:08 (GMT)
commit32ac98e8992caa47ff31e3021444949df058e413 (patch)
tree4128d6224637006b2ab3f1b37f9b1e941fdfbee7 /Python/sysmodule.c
parent0b329f4f03b3e2d603cf81c39e7c9d83da123717 (diff)
downloadcpython-32ac98e8992caa47ff31e3021444949df058e413.zip
cpython-32ac98e8992caa47ff31e3021444949df058e413.tar.gz
cpython-32ac98e8992caa47ff31e3021444949df058e413.tar.bz2
gh-95853: Add script to automate WASM build (GH-95828)
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``. Co-authored-by: Brett Cannon <brett@python.org>
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 e861d9c..b8009b2 100644
--- a/Python/sysmodule.c
+++ b/Python/sysmodule.c
@@ -2789,14 +2789,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 *