diff options
| author | shimizukawa <shimizukawa@gmail.com> | 2012-12-17 04:24:24 +0000 |
|---|---|---|
| committer | shimizukawa <shimizukawa@gmail.com> | 2012-12-17 04:24:24 +0000 |
| commit | f9dced4bfb96284ec4e096fdd2e4c165f3da5086 (patch) | |
| tree | 698c943af25f06631d067af470cd09e1873ce326 | |
| parent | e114686b3b34cbad5d981361e02f4ac33b501d27 (diff) | |
| download | sphinx-f9dced4bfb96284ec4e096fdd2e4c165f3da5086.tar.gz | |
fix test failure: python3 + whoosh
| -rw-r--r-- | sphinx/websupport/search/__init__.py | 2 | ||||
| -rw-r--r-- | tox.ini | 2 |
2 files changed, 3 insertions, 1 deletions
diff --git a/sphinx/websupport/search/__init__.py b/sphinx/websupport/search/__init__.py index 385c3fa9..10e3532d 100644 --- a/sphinx/websupport/search/__init__.py +++ b/sphinx/websupport/search/__init__.py @@ -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], @@ -4,6 +4,8 @@ envlist=py25,py26,py27,py31,py32,py33,pypy,du09,du08,du07 [testenv] deps= nose + sqlalchemy + whoosh setenv = BUILD_TEST_PATH = {envdir}/tests commands= |
