fix(make): Ensure Python 3 compatibility#16
Merged
nerdCopter merged 1 commit intoemuflight:masterfrom Oct 5, 2025
Merged
Conversation
The build script `make.py` was using `ctypes` to monkey-patch the built-in `str` type for path separator conversion. This approach is not compatible with Python 3 and caused the script to fail. This commit refactors the script by removing the `ctypes`-based "magic code" and replacing it with a simple `fix_path` helper function. All calls to the old `.path` property have been updated to use this new, more robust function.
Member
Author
|
builds, flashes, works (unsoldered) |
There was a problem hiding this comment.
Pull Request Overview
This PR fixes Python 3 compatibility issues in the make.py build script by removing unsafe ctypes-based monkey-patching of the built-in str type and replacing it with a simple helper function for path separator conversion.
- Removed complex
ctypescode that was causing crashes in Python 3 - Added a simple
fix_path()helper function for cross-platform path handling - Updated all references from
.pathproperty calls tofix_path()function calls
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
Member
Author
|
@Quick-Flash , please approve. |
Quick-Flash
approved these changes
Oct 5, 2025
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.
The build script
make.pywas usingctypesto monkey-patch the built-instrtype for path separator conversion. This approach is not compatible with Python 3 and caused the script to fail.This commit refactors the script by removing the
ctypes-based "magic code" and replacing it with a simplefix_pathhelper function. All calls to the old.pathproperty have been updated to use this new, more robust function.fixes: