From ca2f31a6f2705022d2d2ce329241b9b07b692f09 Mon Sep 17 00:00:00 2001 From: Robin Richtsfeld Date: Mon, 25 Feb 2019 22:01:47 +0100 Subject: [PATCH] Make signing.py Python2.6+ and Python3+ compat (#5807) Make the signing header generation work under Python2.6+ and Python 3+. --- tools/signing.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tools/signing.py b/tools/signing.py index a323cbc0c..0f266fd8f 100755 --- a/tools/signing.py +++ b/tools/signing.py @@ -27,12 +27,12 @@ def main(): val += "#include \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.