From 4050df583c3221e55e7ada23c211cfc38fae7d89 Mon Sep 17 00:00:00 2001 From: Rob Austein Date: Tue, 1 Sep 2020 10:57:21 -0400 Subject: One more set of silly Python3 bytes handling errors --- projects/hsm/cryptech_probe | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'projects/hsm/cryptech_probe') diff --git a/projects/hsm/cryptech_probe b/projects/hsm/cryptech_probe index 7c26bf4..84359b7 100755 --- a/projects/hsm/cryptech_probe +++ b/projects/hsm/cryptech_probe @@ -102,8 +102,12 @@ for port in ports: except serial.SerialException: time.sleep(0.2) - for c in probe_string: - tty.write(c) + # Not sure we really need to dribble the probe string out this slowly anymore, + # but once upon a time we did this for a reason and it's not like this program + # is a performance bottleneck, so stick with the safe version. + + for i in range(len(probe_string)): + tty.write(probe_string[i:i+1]) time.sleep(0.1) response = tty.read(args.read_buffer_size) -- cgit v1.2.3