aboutsummaryrefslogtreecommitdiff
path: root/scripts/checkrom.py
diff options
context:
space:
mode:
authorJohannes Krampf <johannes.krampf@googlemail.com>2014-01-19 16:03:49 +0100
committerKevin O'Connor <kevin@koconnor.net>2014-01-20 12:42:44 -0500
commit19f789bdfd58eba2ed8fe604bbabf8df0fcc0771 (patch)
tree51c49104aec5b420382f82f71e3b4a8edf0be8f1 /scripts/checkrom.py
parent0a82fc743c5ec1553f745bec6fc8bc8780088fd8 (diff)
downloadseabios-hppa-19f789bdfd58eba2ed8fe604bbabf8df0fcc0771.zip
seabios-hppa-19f789bdfd58eba2ed8fe604bbabf8df0fcc0771.tar.gz
seabios-hppa-19f789bdfd58eba2ed8fe604bbabf8df0fcc0771.tar.bz2
build: Be careful with unicode and byte strings for python3 compatibility.
Signed-off-by: Johannes Krampf <johannes.krampf@googlemail.com>
Diffstat (limited to 'scripts/checkrom.py')
-rwxr-xr-xscripts/checkrom.py6
1 files changed, 4 insertions, 2 deletions
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__':