From c57cb56fde4e565600dbf241a383738e30870beb Mon Sep 17 00:00:00 2001 From: Yaroslav Halchenko Date: Tue, 30 Apr 2013 13:47:45 -0400 Subject: [PATCH] BF: previous monkey-patch doesn't work with elderly backport of sphinx (1.0.7) on squeeze --- sphinx/conf.py | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/sphinx/conf.py b/sphinx/conf.py index 5949bc3..19a1456 100644 --- a/sphinx/conf.py +++ b/sphinx/conf.py @@ -78,8 +78,16 @@ release = '' # Monkey patch "English" language regular expression so we could # search for package names as well import re -from sphinx.search.en import SearchEnglish -SearchEnglish._word_re = re.compile(r'[-.\w]+(?u)') +word_re = re.compile(r'[-.\w]+(?u)') + +import sphinx.search +# older versions (before 1.1.3, 1.0.7 for sure) had no language +# customizations +if hasattr(sphinx.search, 'word_re'): + sphinx.search.word_re = word_re +else: + from sphinx.search.en import SearchEnglish + SearchEnglish._word_re = word_re # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. -- 2.39.2