Skip to content

Commit 787fccb

Browse files
Tzung-Bi Shihshuahkh
authored andcommitted
selftests: tpm2: remove redundant ord()
When testing with FLAG_DEBUG enabled client, it emits the following error messages: File "/root/tpm2/tpm2.py", line 347, in hex_dump d = [format(ord(x), '02x') for x in d] File "/root/tpm2/tpm2.py", line 347, in <listcomp> d = [format(ord(x), '02x') for x in d] TypeError: ord() expected string of length 1, but int found The input of hex_dump() should be packed binary data. Remove the ord(). Signed-off-by: Tzung-Bi Shih <[email protected]> Signed-off-by: Shuah Khan <[email protected]>
1 parent 4ebe333 commit 787fccb

File tree

1 file changed

+1
-1
lines changed
  • tools/testing/selftests/tpm2

1 file changed

+1
-1
lines changed

tools/testing/selftests/tpm2/tpm2.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -344,7 +344,7 @@ def get_algorithm(name):
344344

345345

346346
def hex_dump(d):
347-
d = [format(ord(x), '02x') for x in d]
347+
d = [format(x, '02x') for x in d]
348348
d = [d[i: i + 16] for i in range(0, len(d), 16)]
349349
d = [' '.join(x) for x in d]
350350
d = os.linesep.join(d)

0 commit comments

Comments
 (0)