From: He Yin Ling Date: Thu, 29 Nov 2018 06:33:36 +0000 (+0800) Subject: tiny-test-fw: fix exception when expect RegEx: X-Git-Tag: v3.2-beta3~72^2~1 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=61d07ffbfc9792e94e1e9e3980a96dcd65a245bb;p=esp-idf tiny-test-fw: fix exception when expect RegEx: match.groups() could return None. We can't do decode on None object. --- diff --git a/tools/tiny-test-fw/DUT.py b/tools/tiny-test-fw/DUT.py index 88894fd496..899c7e8850 100644 --- a/tools/tiny-test-fw/DUT.py +++ b/tools/tiny-test-fw/DUT.py @@ -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