Use TypeError instead of AssertionError for no sequence

Improve/extends tests.
This commit is contained in:
Daniel Hahler
2020-02-01 22:06:15 +01:00
parent 09a0e45492
commit b10ab0211c
2 changed files with 15 additions and 3 deletions

View File

@@ -1430,7 +1430,8 @@ class LineMatcher:
:param str match_nickname: the nickname for the match function that
will be logged to stdout when a match occurs
"""
assert isinstance(lines2, collections.abc.Sequence)
if not isinstance(lines2, collections.abc.Sequence):
raise TypeError("invalid type for lines2: {}".format(type(lines2).__name__))
lines2 = self._getlines(lines2)
lines1 = self.lines[:]
nextline = None