From 19f789bdfd58eba2ed8fe604bbabf8df0fcc0771 Mon Sep 17 00:00:00 2001 From: Johannes Krampf Date: Sun, 19 Jan 2014 16:03:49 +0100 Subject: build: Be careful with unicode and byte strings for python3 compatibility. Signed-off-by: Johannes Krampf --- scripts/checkrom.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'scripts/checkrom.py') diff --git a/scripts/checkrom.py b/scripts/checkrom.py index 30c9db2..83d4671 100755 --- a/scripts/checkrom.py +++ b/scripts/checkrom.py @@ -8,6 +8,8 @@ import sys import layoutrom +from python23compat import as_bytes + def subst(data, offset, new): return data[:offset] + new + data[offset + len(new):] @@ -24,7 +26,7 @@ def main(): objinfo, finalsize, rawfile, outfile = sys.argv[1:] # Read in symbols - objinfofile = open(objinfo, 'rb') + objinfofile = open(objinfo, 'r') symbols = layoutrom.parseObjDump(objinfofile, 'in')[1] # Read in raw file @@ -90,7 +92,7 @@ def main(): # Write final file f = open(outfile, 'wb') - f.write(("\0" * (finalsize - datasize)) + rawdata) + f.write((as_bytes("\0") * (finalsize - datasize)) + rawdata) f.close() if __name__ == '__main__': -- cgit v1.1