From: Yaroslav Halchenko Date: Tue, 30 Apr 2013 17:47:45 +0000 (-0400) Subject: BF: previous monkey-patch doesn't work with elderly backport of sphinx (1.0.7) on... X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=c57cb56fde4e565600dbf241a383738e30870beb;p=neurodebian.git BF: previous monkey-patch doesn't work with elderly backport of sphinx (1.0.7) on squeeze --- 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.