Fix desktop run: handle missing _webrepl module#93
Open
bitcoin3us wants to merge 1 commit intoMicroPythonOS:mainfrom
Open
Fix desktop run: handle missing _webrepl module#93bitcoin3us wants to merge 1 commit intoMicroPythonOS:mainfrom
bitcoin3us wants to merge 1 commit intoMicroPythonOS:mainfrom
Conversation
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]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
mpos/__init__.py→webserver.py→webrepl_http.py) requires the_webreplC module which is only available on ESP32 buildsImportErrorthat prevents the entirempospackage from loading, breakingrun_desktop.shtry/exceptso desktop builds skip WebServer gracefully (sets it toNone)main.pyalready has a similar guard aroundWebServer.auto_start(), so this is consistentTest plan
scripts/run_desktop.shon macOS/Linux — should launch withoutImportError🤖 Generated with Claude Code