Skip to content

Commit ca2f31a

Browse files
Androbinearlephilhower
authored andcommitted
Make signing.py Python2.6+ and Python3+ compat (#5807)
Make the signing header generation work under Python2.6+ and Python 3+.
1 parent 167f39d commit ca2f31a

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

tools/signing.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,12 @@ def main():
2727
val += "#include <pgmspace.h>\n"
2828
val += "#define ARDUINO_SIGNING 1\n"
2929
val += "static const char signing_pubkey[] PROGMEM = {\n"
30-
for i in pub:
31-
val += "0x%02x, \n" % ord(i)
30+
for i in bytearray(pub):
31+
val += "0x%02x, \n" % i
3232
val = val[:-3]
3333
val +="\n};\n"
3434
sys.stderr.write("Enabling binary signing\n")
35-
except:
35+
except IOError:
3636
# Silence the default case to avoid people thinking something is wrong.
3737
# Only people who care about signing will know what it means, anyway,
3838
# and they can check for the positive acknowledgement above.

0 commit comments

Comments
 (0)