tiny-test-fw: fix exception when expect RegEx:

match.groups() could return None. We can't do decode on None object.
This commit is contained in:
He Yin Ling 2018-11-29 14:33:36 +08:00 committed by bot
parent 6b5649190f
commit 61d07ffbfc

View file

@ -530,7 +530,7 @@ class BaseDUT(object):
data = BaseDUT.u_to_bytearray(data)
match = pattern.search(data)
if match:
ret = tuple(x.decode() for x in match.groups())
ret = tuple(None if x is None else x.decode() for x in match.groups())
index = match.end()
else:
index = -1