fix bug calling search_exact() without passing end_index
This commit is contained in:
parent
3af23d3a60
commit
05f33c4337
|
@ -154,9 +154,12 @@ else:
|
|||
_search_exact = search_exact
|
||||
@wraps(_search_exact)
|
||||
def search_exact(subsequence, sequence, start_index=0, end_index=None):
|
||||
if end_index is None:
|
||||
end_index = len(sequence)
|
||||
|
||||
try:
|
||||
return search_exact_byteslike(subsequence, sequence,
|
||||
start_index, end_index if end_index is not None else -1)
|
||||
start_index, end_index)
|
||||
except (TypeError, UnicodeEncodeError):
|
||||
return _search_exact(subsequence, sequence, start_index, end_index)
|
||||
|
||||
|
|
Loading…
Reference in New Issue