diff options
author | PikalaxALT <pikalaxalt@gmail.com> | 2018-06-03 11:04:37 -0400 |
---|---|---|
committer | PikalaxALT <pikalaxalt@gmail.com> | 2018-06-03 11:05:31 -0400 |
commit | 344904e2e0bb8b4b9db7e86cd8849a77c77247af (patch) | |
tree | b35ccd62b490780ad35e68148e81e47fd84d6012 | |
parent | 634df276352ea64c6eff423bb706cfae8a39a67b (diff) | |
parent | 3a7ac51071ad9f3ae277046c29d7482b56754d1d (diff) |
Merge branch 'master' into build_more_roms
-rw-r--r-- | Makefile | 2 | ||||
-rw-r--r-- | tools/disasm_coverage.py | 9 |
2 files changed, 8 insertions, 3 deletions
@@ -53,7 +53,7 @@ tools tools/pkmncompress tools/gfx: .PHONY: coverage coverage: tools/disasm_coverage.py $(ROM) - $(PYTHON3) $< -m $(ROM:.gb=.map) -b 0x40 + $(PYTHON) $< -m $(ROM:.gb=.map) -b 0x40 # Remove files generated by the build process. .PHONY: clean diff --git a/tools/disasm_coverage.py b/tools/disasm_coverage.py index 6c1c030..39d1960 100644 --- a/tools/disasm_coverage.py +++ b/tools/disasm_coverage.py @@ -29,8 +29,13 @@ if __name__ == "__main__": rows_per_bank = bank_size // (width * bpp) r = MapReader() - with open(args.mapfile, 'r', encoding= "utf-8") as f: - l = f.readlines() + try: + with open(args.mapfile, 'r') as f: + l = f.readlines() + except UnicodeDecodeError: + # Python 3 seems to choke on the file's encoding, but the `encoding` keyword only works on Py3 + with open(args.mapfile, 'r', encoding= "utf-8") as f: + l = f.readlines() r.read_map_data(l) hit_data = [[0] * width for _ in range(height)] |