Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use subprocess in bas2prg #116

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

LRFLEW
Copy link
Contributor

@LRFLEW LRFLEW commented Apr 12, 2021

This makes a small change to the python script tools/bas2prg.py, replacing the call to os.system with subprocess.run.

I was attempting to build the demos on my Windows machine (I've mostly used my mac with this project before) and was having issues with this line. I'm using MSys2 (and MinGW) for Makefile support, but os.system runs using cmd.exe. The problem is that cmd.exe doesn't handle forward slashes in paths, so the path specified in the Makefile causes problems. Switching to subprocess.run avoids this issue by not calling any shell (since shell=False), letting the OS handle the forward slashes as it normally does. Making this change also has the advantage of better handling spaces in the path.

I also went ahead and added a variable to the makefile to allow it to work when the emulator is located somewhere else. This can be utilized by calling make using EMULATOR=/path/to/x16emu make.

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