summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarkus Mohrhard <markus.mohrhard@googlemail.com>2016-08-30 02:34:58 +0200
committerMarkus Mohrhard <markus.mohrhard@googlemail.com>2017-05-19 03:43:21 +0200
commita68eda414e46aecf0ae50f552ed2e408524bd554 (patch)
tree9e7d4d31fe8fbe67568ca4f6d8c8c00ff98bbc27
parente70d1cd3014ea9ff360d7cd203206332b7aa6cfd (diff)
make the script more python3 compliant
Change-Id: Id23b4890f121c0ffeb7aca4888e1e1d4d3748b91
-rwxr-xr-x[-rw-r--r--]onlineupdate/source/update/updater/gen_cert_header.py10
1 files changed, 6 insertions, 4 deletions
diff --git a/onlineupdate/source/update/updater/gen_cert_header.py b/onlineupdate/source/update/updater/gen_cert_header.py
index 182e98b64443..5fff9be79084 100644..100755
--- a/onlineupdate/source/update/updater/gen_cert_header.py
+++ b/onlineupdate/source/update/updater/gen_cert_header.py
@@ -1,3 +1,5 @@
+#!/usr/bin/env python
+
import sys
import binascii
@@ -13,13 +15,13 @@ def file_byte_generator(filename, block_size = 512):
def create_header(array_name, in_filename):
hexified = ["0x" + binascii.hexlify(byte) for byte in file_byte_generator(in_filename)]
- print "const uint8_t " + array_name + "[] = {"
- print ", ".join(hexified)
- print "};"
+ print("const uint8_t " + array_name + "[] = {")
+ print(", ".join(hexified))
+ print("};")
return 0
if __name__ == '__main__':
if len(sys.argv) < 3:
- print 'ERROR: usage: gen_cert_header.py array_name in_filename'
+ print('ERROR: usage: gen_cert_header.py array_name in_filename')
sys.exit(1);
sys.exit(create_header(sys.argv[1], sys.argv[2]))