1
0
mirror of https://github.com/esp8266/Arduino.git synced 2025-06-06 05:21:22 +03:00

Make signing.py Python2.6+ and Python3+ compat (#5807)

Make the signing header generation work under Python2.6+ and Python 3+.
This commit is contained in:
Robin Richtsfeld 2019-02-25 22:01:47 +01:00 committed by Earle F. Philhower, III
parent 167f39dab6
commit ca2f31a6f2

View File

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