[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.
This commit is contained in:
tomaszkob89
2021-12-22 22:23:02 -08:00
committed by GitHub
parent 9e161b96b5
commit 4fcd48ce8c
+3 -1
View File
@@ -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