kopia lustrzana https://github.com/micropython/micropython-lib
binsacii: unhexlify: Raise ValueError.
rodzic
a38c3ce60c
commit
f7e11169de
|
@ -2,7 +2,7 @@ from ubinascii import hexlify
|
|||
|
||||
def unhexlify(data):
|
||||
if len(data) % 2 != 0:
|
||||
raise Exception("Odd-length string")
|
||||
raise ValueError("Odd-length string")
|
||||
|
||||
return bytes([ int(data[i:i+2], 16) for i in range(0, len(data), 2) ])
|
||||
|
||||
|
|
Ładowanie…
Reference in New Issue