diff --git a/freesia/__main__.py b/freesia/__main__.py index 858b369..547c43f 100755 --- a/freesia/__main__.py +++ b/freesia/__main__.py @@ -1,5 +1,8 @@ -import argparse, sys -from pathlib import Path +#!/usr/bin/env python + +from __future__ import print_function + +import argparse, sys, os.path argparser = argparse.ArgumentParser(description="Locates free space inside a GBA ROM.") argparser.add_argument("--rom", dest="ROM", required=True) @@ -40,7 +43,7 @@ def find_needed_bytes(rom, needed_bytes, start_at): else: record += 1 elif len(val) < 4: - print(f"{Path(sys.argv[0]).name}: error: end of file reached before a suitable location was found", file=sys.stderr) + print("{}: error: end of file reached before a suitable location was found".format(os.path.basename(sys.argv[0])), file=sys.stderr) sys.exit(1) else: record, start = 0, None @@ -54,4 +57,4 @@ def find_needed_bytes(rom, needed_bytes, start_at): addr = find_needed_bytes(rom=args.ROM, needed_bytes=args.NEEDED_BYTES, start_at=args.START_AT) | 0x08000000 -print(f"0x{addr :08X}") +print("0x{0:08X}".format(addr))