Skip to content

wasm: check platform instead of sys.modules for pyodide check#9404

Merged
mscolnick merged 3 commits into
mainfrom
ms/wasm-check-platform-instead-of-sysmodules-for-pyodide-check
Apr 27, 2026
Merged

wasm: check platform instead of sys.modules for pyodide check#9404
mscolnick merged 3 commits into
mainfrom
ms/wasm-check-platform-instead-of-sysmodules-for-pyodide-check

Conversation

@mscolnick

@mscolnick mscolnick commented Apr 27, 2026

Copy link
Copy Markdown
Contributor

Switch to use sys.platform = "emscripten" than potentially corrupted sys.modules

Copilot AI review requested due to automatic review settings April 27, 2026 20:29
@vercel

vercel Bot commented Apr 27, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
marimo-docs Ready Ready Preview, Comment Apr 27, 2026 9:04pm

Request Review

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates Marimo’s runtime platform detection to identify Pyodide/WASM by checking the interpreter’s platform string rather than relying on whether the pyodide module has been imported.

Changes:

  • Update is_pyodide() to use sys.platform == "emscripten" instead of "pyodide" in sys.modules.

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 1 file

The @patch.dict(sys.modules, ...) approach no longer triggers
is_pyodide() now that it checks sys.platform == "emscripten".

@dmadisetti dmadisetti left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice cleanup

@mscolnick mscolnick merged commit 4a52d08 into main Apr 27, 2026
44 checks passed
@mscolnick mscolnick deleted the ms/wasm-check-platform-instead-of-sysmodules-for-pyodide-check branch April 27, 2026 21:41
@github-actions

Copy link
Copy Markdown
Contributor

🚀 Development release published. You may be able to view the changes at https://marimo.app?v=0.23.4-dev14

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

3 participants