Fixed error # #1095 (#1098)

The error: TypeError: expected string or bytes-like object can be fixed by just a str to the line:
         return [(m.start(), m.end(), getSearchResultContext(text, m.start(), m.end())) for m in searchRegex.finditer(text)]
This commit is contained in:
TheShadowOfHassen 2022-12-29 16:07:31 -05:00 committed by GitHub
parent a36bc55bf2
commit acd23e9651
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -469,7 +469,7 @@ def search(searchRegex, text):
:return: list of tuples (startPos, endPos)
"""
if text is not None:
return [(m.start(), m.end(), getSearchResultContext(text, m.start(), m.end())) for m in searchRegex.finditer(text)]
return [(m.start(), m.end(), getSearchResultContext(text, m.start(), m.end())) for m in searchRegex.finditer(str(text))]
else:
return []