Make the script portable to both pythons
Make the script work for python3 and for python2
This commit is contained in:
parent
5075f4df18
commit
64e45950de
1 changed files with 2 additions and 2 deletions
|
@ -270,7 +270,7 @@ class MbedTlsTest(BaseHostTest):
|
||||||
data_bytes += b'S'
|
data_bytes += b'S'
|
||||||
self.align_32bit(data_bytes)
|
self.align_32bit(data_bytes)
|
||||||
data_bytes += self.int32_to_big_endian_bytes(i)
|
data_bytes += self.int32_to_big_endian_bytes(i)
|
||||||
data_bytes += bytes(param, 'ascii')
|
data_bytes += bytearray(param, encoding='ascii')
|
||||||
data_bytes += b'\0' # Null terminate
|
data_bytes += b'\0' # Null terminate
|
||||||
elif typ == 'hex':
|
elif typ == 'hex':
|
||||||
binary_data = self.hex_str_bytes(param)
|
binary_data = self.hex_str_bytes(param)
|
||||||
|
@ -309,7 +309,7 @@ class MbedTlsTest(BaseHostTest):
|
||||||
|
|
||||||
param_bytes, length = self.test_vector_to_bytes(function_id,
|
param_bytes, length = self.test_vector_to_bytes(function_id,
|
||||||
dependencies, args)
|
dependencies, args)
|
||||||
self.send_kv(length.hex(), param_bytes.hex())
|
self.send_kv(''.join('{:02x}'.format(x) for x in length), ''.join('{:02x}'.format(x) for x in param_bytes))
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def get_result(value):
|
def get_result(value):
|
||||||
|
|
Loading…
Reference in a new issue