upleb.uk

Public git repos — served from a NIP-34 GRASP relay at git.upleb.uk

summaryrefslogtreecommitdiff
path: root/runtime/src/pe_loader.cpp
diff options
context:
space:
mode:
authorAnira <67195196+zxcvqwerasdf@users.noreply.github.com>2026-11-22 16:38:03 +0200
committerAnira <67195196+zxcvqwerasdf@users.noreply.github.com>2026-11-22 16:54:40 +0200
commit3eb204899ab0da77e3835c077249874ff1aa59ba (patch)
treeecf09ab544f4ec696f4362aab2d35038067cbabe /runtime/src/pe_loader.cpp
parent6a6704df1592e1dc4a3215ddf1423a78adb52045 (diff)
Tools: put the script's own directory on sys.path in the two that need it
`python -I` implies `-P`, so the directory of the script is not `sys.path[0]` and a tool that imports the module next to it dies before `main()`: python -I tools/calibrated_texture.py --help ModuleNotFoundError: No module named 'bcpack' `calibrated_texture.py` imports `bcpack`, `bcpack_tables` and `ttpf_mips` and added nothing; `ttpf_assets.py` imports `bcpack`, `file_mode`, `ttpf_mips` and `calibrated_texture` and added nothing either, so the build's texture stage tools could only be run through `make_game.py`, never directly as CONTRIBUTING.md documents. Insert `os.path.dirname(os.path.abspath(__file__))` before the sibling imports, the pattern already used by `tools/anim_clips.py`. `tests/test_tool_startup.py` derives the affected set from the sources and runs `python -I <tool> --help` for all of them, so a new tool with a sibling import is covered without editing the test; without the two fixes it fails exactly on those two tools. A sweep of `python -I tools/*.py --help` over all 110 tools found no other case.
Diffstat (limited to 'runtime/src/pe_loader.cpp')
0 files changed, 0 insertions, 0 deletions