mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2026-10-13 17:02:12 -05:00
fix test failure: python3 + whoosh
This commit is contained in:
1 parent
066c432152
commit
5e8d7b9c38
2 files changed
+3
-1
No files matched your search
@@ -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