Merge branch 'bugfix/ttfw_fix_flush_index_error_v3.3' into 'release/v3.3'

test: TTFW fix flush index error (v3.3)

See merge request espressif/esp-idf!14266
This commit is contained in:
Anton Maklakov 2021-07-30 06:35:24 +00:00
commit 09840aeeaa

View File

@ -543,13 +543,11 @@ class BaseDUT(object):
:return: match groups if match succeed otherwise None
"""
ret = None
if isinstance(pattern.pattern, type(u'')):
pattern = re.compile(BaseDUT.u_to_bytearray(pattern.pattern))
if isinstance(data, type(u'')):
data = BaseDUT.u_to_bytearray(data)
if isinstance(pattern.pattern, bytes):
pattern = re.compile(_decode_data(pattern.pattern))
match = pattern.search(data)
if match:
ret = tuple(None if x is None else x.decode() for x in match.groups())
ret = tuple(x for x in match.groups())
index = match.end()
else:
index = -1