mirror of
https://github.com/olivierkes/manuskript.git
synced 2024-05-08 15:02:24 +12:00
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:
parent
a36bc55bf2
commit
acd23e9651
|
@ -469,7 +469,7 @@ def search(searchRegex, text):
|
||||||
:return: list of tuples (startPos, endPos)
|
:return: list of tuples (startPos, endPos)
|
||||||
"""
|
"""
|
||||||
if text is not None:
|
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:
|
else:
|
||||||
return []
|
return []
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue