Ver Fonte

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

match.groups() could return None. We can't do decode on None object.
He Yin Ling há 7 anos atrás
pai
commit
5ae3a11c8d
1 ficheiros alterados com 1 adições e 1 exclusões
  1. 1 1
      tools/tiny-test-fw/DUT.py

+ 1 - 1
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