aboutsummaryrefslogtreecommitdiff
path: root/scripts/transdump.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/transdump.py
parent0a82fc743c5ec1553f745bec6fc8bc8780088fd8 (diff)
downloadseabios-19f789bdfd58eba2ed8fe604bbabf8df0fcc0771.zip
seabios-19f789bdfd58eba2ed8fe604bbabf8df0fcc0771.tar.gz
seabios-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/transdump.py')
-rwxr-xr-xscripts/transdump.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/scripts/transdump.py b/scripts/transdump.py
index 4caaeb7..665f04a 100755
--- a/scripts/transdump.py
+++ b/scripts/transdump.py
@@ -44,7 +44,10 @@ def main():
filehdl = open(filename, 'r')
mem = parseMem(filehdl)
for i in mem:
- sys.stdout.write(struct.pack("<I", i))
+ if (sys.version_info > (3, 0)):
+ sys.stdout.buffer.write(struct.pack("<I", i))
+ else:
+ sys.stdout.write(struct.pack("<I", i))
if __name__ == '__main__':
main()