1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2024-11-29 10:58:21 +00:00

use binascii.hexlify instead of bytearray.hex (which doesn't exist in python < 3.5)

This commit is contained in:
matejcik 2018-03-09 14:24:36 +01:00
parent 5edcea9ba6
commit 6b51228090

View File

@ -113,7 +113,7 @@ def format_protobuf(pb, indent=0, sep=' ' * 4):
lines.append(level + '}')
return '\n'.join(lines)
if isinstance(value, bytearray):
return 'bytearray(0x{})'.format(value.hex())
return 'bytearray(0x{})'.format(binascii.hexlify(value).decode('ascii'))
return repr(value)