Skip to content

Fix desktop run: handle missing _webrepl module#93

Open
bitcoin3us wants to merge 1 commit intoMicroPythonOS:mainfrom
bitcoin3us:fix-desktop-webrepl-import
Open

Fix desktop run: handle missing _webrepl module#93
bitcoin3us wants to merge 1 commit intoMicroPythonOS:mainfrom
bitcoin3us:fix-desktop-webrepl-import

Conversation

@bitcoin3us
Copy link
Copy Markdown
Contributor

Summary

  • The WebServer import chain (mpos/__init__.pywebserver.pywebrepl_http.py) requires the _webrepl C module which is only available on ESP32 builds
  • On desktop/Unix systems this causes an ImportError that prevents the entire mpos package from loading, breaking run_desktop.sh
  • Wraps the import in try/except so desktop builds skip WebServer gracefully (sets it to None)
  • main.py already has a similar guard around WebServer.auto_start(), so this is consistent

Test plan

  • Run scripts/run_desktop.sh on macOS/Linux — should launch without ImportError
  • Run on ESP32 hardware — WebServer should still import and function normally

🤖 Generated with Claude Code

The WebServer import chain (mpos/__init__.py → webserver.py →
webrepl_http.py) requires the _webrepl C module which is only
available on ESP32 builds. This causes an ImportError on desktop/Unix
systems, preventing the entire mpos package from loading.

Wrap the import in try/except so desktop builds can still run.
main.py already has a similar guard around WebServer.auto_start().

Co-Authored-By: Claude Opus 4.6 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant