# DP: Allow docs to be built with Sphinx 0.5.x. --- a/Doc/tools/sphinxext/pyspecific.py +++ b/Doc/tools/sphinxext/pyspecific.py @@ -171,8 +171,15 @@ from docutils.io import StringOutput from docutils.utils import new_document -from sphinx.builders import Builder -from sphinx.writers.text import TextWriter +try: + from sphinx.builders import Builder +except ImportError: + from sphinx.builder import Builder + +try: + from sphinx.writers.text import TextWriter +except ImportError: + from sphinx.textwriter import TextWriter class PydocTopicsBuilder(Builder): --- a/Doc/tools/sphinxext/suspicious.py +++ b/Doc/tools/sphinxext/suspicious.py @@ -47,7 +47,12 @@ import sys from docutils import nodes -from sphinx.builders import Builder + +try: + from sphinx.builders import Builder +except ImportError: + from sphinx.builder import Builder + detect_all = re.compile(r''' ::(?=[^=])| # two :: (but NOT ::=)