mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
fix test failure: python3 + whoosh
This commit is contained in:
@@ -102,7 +102,7 @@ class BaseSearch(object):
|
||||
res = self.context_re.search(text)
|
||||
if res is None:
|
||||
return ''
|
||||
context_start = max(res.start() - length/2, 0)
|
||||
context_start = max(res.start() - int(length/2), 0)
|
||||
context_end = context_start + length
|
||||
context = ''.join([context_start > 0 and '...' or '',
|
||||
text[context_start:context_end],
|
||||
|
||||
Reference in New Issue
Block a user