]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
gh-124621: Emscripten: Support pyrepl in browser (GH-136931)
authorHood Chatham <roberthoodchatham@gmail.com>
Tue, 22 Jul 2025 10:13:38 +0000 (12:13 +0200)
committerGitHub <noreply@github.com>
Tue, 22 Jul 2025 10:13:38 +0000 (12:13 +0200)
commitc933a6bb329bb97bc7e448388dad1b74f7ca4baa
tree850196c0b9ed5cd0f3a78b3858bf592047525c5f
parent22c8658906526032c24bb2f4a02fb28e2d366bcb
gh-124621: Emscripten: Support pyrepl in browser (GH-136931)

Basic support for pyrepl in Emscripten. Limitations:
* requires JSPI
* no signal handling implemented

As followup work, it would be nice to implement a webworker variant
for when JSPI is not available and proper signal handling.

Because it requires JSPI, it doesn't work in Safari. Firefox requires
setting an experimental flag. All the Chromiums have full support since
May. Until we make it work without JSPI, let's keep the original web_example
around.

Co-authored-by: Łukasz Langa <lukasz@langa.pl>
Co-authored-by: Éric <merwok@netwok.org>
13 files changed:
Lib/_pyrepl/trace.py
Lib/test/test_fcntl.py
Makefile.pre.in
Misc/NEWS.d/next/Library/2025-07-21-16-10-24.gh-issue-124621.wyoWc1.rst [new file with mode: 0644]
Modules/clinic/posixmodule.c.h
Modules/posixmodule.c
Python/emscripten_syscalls.c
Tools/wasm/emscripten/config.site-wasm32-emscripten
Tools/wasm/emscripten/wasm_assets.py [moved from Tools/wasm/emscripten/web_example/wasm_assets.py with 98% similarity]
Tools/wasm/emscripten/web_example_pyrepl_jspi/index.html [new file with mode: 0644]
Tools/wasm/emscripten/web_example_pyrepl_jspi/src.mjs [new file with mode: 0644]
configure
configure.ac