]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
[3.14] gh-124621: Emscripten: Support pyrepl in browser (GH-136931) (GH-136988)
authorŁukasz Langa <lukasz@langa.pl>
Tue, 22 Jul 2025 13:04:11 +0000 (15:04 +0200)
committerGitHub <noreply@github.com>
Tue, 22 Jul 2025 13:04:11 +0000 (15:04 +0200)
commit591019e1f2345d2f7520569c78927add5950a5ef
tree19821d7685af0e235874a1033533d3733bc97074
parent8e3c3b5bbc8cf34673b19cb35c706699184e1d6d
[3.14] gh-124621: Emscripten: Support pyrepl in browser (GH-136931) (GH-136988)

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.
(cherry picked from commit c933a6bb329bb97bc7e448388dad1b74f7ca4baa)

Co-authored-by: Hood Chatham <roberthoodchatham@gmail.com>
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