From 4fcd48ce8c338b5f5c958d066fc9426ee15c4e5e Mon Sep 17 00:00:00 2001 From: tomaszkob89 Date: Thu, 23 Dec 2021 07:23:02 +0100 Subject: [PATCH] [thci] drop empty lines returned in command outout from the response (#7236) In some cases the first element from the output from __executeCommand might be empty line, which casues command failures like on below trace: __executeCommand('extaddr',) returns ['', '166e0a0000000001', '', 'Done'] FUNC getMAC failed: invalid literal for int() with base 16: '' This commit filters out empty string from the result of __executeCommand. --- tools/harness-thci/OpenThread.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tools/harness-thci/OpenThread.py b/tools/harness-thci/OpenThread.py index 7f5001f26..335a79f14 100644 --- a/tools/harness-thci/OpenThread.py +++ b/tools/harness-thci/OpenThread.py @@ -298,7 +298,9 @@ class OpenThreadTHCI(object): continue self.log("readline: %s", line) - response.append(line) + # skip empty lines + if line: + response.append(line) if line.endswith('Done'): break