diff --git a/Doc/tools/sphinxext/pyspecific.py b/Doc/tools/sphinxext/pyspecific.py index c3268e946d1..018f4aca243 100644 --- a/Doc/tools/sphinxext/pyspecific.py +++ b/Doc/tools/sphinxext/pyspecific.py @@ -48,15 +48,9 @@ from pprint import pformat from docutils.io import StringOutput from docutils.utils import new_document -try: - from sphinx.builders import Builder -except ImportError: - from sphinx.builder import Builder +from sphinx.builders import Builder +from sphinx.writers.text import TextWriter -try: - from sphinx.writers.text import TextWriter -except ImportError: - from sphinx.textwriter import TextWriter class PydocTopicsBuilder(Builder): name = 'pydoc-topics' diff --git a/Doc/tools/sphinxext/suspicious.py b/Doc/tools/sphinxext/suspicious.py index 9a2f60128bb..ae11793ea54 100644 --- a/Doc/tools/sphinxext/suspicious.py +++ b/Doc/tools/sphinxext/suspicious.py @@ -45,7 +45,7 @@ import os, sys import csv import re from docutils import nodes -from sphinx.builder import Builder +from sphinx.builders import Builder detect_all = re.compile(ur''' ::(?=[^=])| # two :: (but NOT ::=)