]> git.donarmstrong.com Git - neurodebian.git/commitdiff
BF: previous monkey-patch doesn't work with elderly backport of sphinx (1.0.7) on...
authorYaroslav Halchenko <debian@onerussian.com>
Tue, 30 Apr 2013 17:47:45 +0000 (13:47 -0400)
committerYaroslav Halchenko <debian@onerussian.com>
Tue, 30 Apr 2013 17:47:45 +0000 (13:47 -0400)
sphinx/conf.py

index 5949bc3e956f94294cb74f2f94c3a18d050f4142..19a1456546a587fe7fbb2f7d63c3e23d709e25a2 100644 (file)
@@ -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.