From 5ae3a11c8d32590b8165703d648383d0f3d985fd Mon Sep 17 00:00:00 2001 From: He Yin Ling Date: Thu, 29 Nov 2018 14:33:36 +0800 Subject: [PATCH] tiny-test-fw: fix exception when expect RegEx: match.groups() could return None. We can't do decode on None object. --- tools/tiny-test-fw/DUT.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 -- 2.40.0