apj_tool: fix binary writes

This commit is contained in:
Michael Oborne 2018-12-05 06:37:35 +08:00 committed by Andrew Tridgell
parent f5208b1664
commit a24f870a0d

View File

@ -54,7 +54,7 @@ class embedded_defaults(object):
def save_binary(self):
'''save binary file'''
f = open(self.filename, 'w')
f = open(self.filename, 'wb')
f.write(self.firmware)
f.close()
print("Saved binary of length %u" % len(self.firmware))
@ -188,7 +188,7 @@ class embedded_defaults(object):
a = (a[0], '.bin')
binfile = ''.join(a)
print("Extracting firmware to %s" % binfile)
f = open(binfile,'w')
f = open(binfile,'wb')
f.write(self.firmware)
f.close()