summaryrefslogtreecommitdiff
path: root/sphinx/ext/doctest.py
diff options
context:
space:
mode:
Diffstat (limited to 'sphinx/ext/doctest.py')
-rw-r--r--sphinx/ext/doctest.py15
1 files changed, 3 insertions, 12 deletions
diff --git a/sphinx/ext/doctest.py b/sphinx/ext/doctest.py
index 26966016d..48ebcd34e 100644
--- a/sphinx/ext/doctest.py
+++ b/sphinx/ext/doctest.py
@@ -13,10 +13,10 @@ import doctest
import re
import sys
import time
-import warnings
from io import StringIO
from os import path
-from typing import Any, Callable, Dict, Iterable, List, Sequence, Set, Tuple
+from typing import Any, Callable, Dict, Iterable, List, Sequence, Set, Tuple, Type
+from typing import TYPE_CHECKING
from docutils import nodes
from docutils.nodes import Element, Node, TextElement
@@ -26,16 +26,13 @@ from packaging.version import Version
import sphinx
from sphinx.builders import Builder
-from sphinx.deprecation import RemovedInSphinx40Warning
from sphinx.locale import __
from sphinx.util import logging
from sphinx.util.console import bold # type: ignore
from sphinx.util.docutils import SphinxDirective
from sphinx.util.osutil import relpath
-if False:
- # For type annotation
- from typing import Type # for python3.5.1
+if TYPE_CHECKING:
from sphinx.application import Sphinx
@@ -45,12 +42,6 @@ blankline_re = re.compile(r'^\s*<BLANKLINE>', re.MULTILINE)
doctestopt_re = re.compile(r'#\s*doctest:.+$', re.MULTILINE)
-def doctest_encode(text: str, encoding: str) -> str:
- warnings.warn('doctest_encode() is deprecated.',
- RemovedInSphinx40Warning, stacklevel=2)
- return text
-
-
def is_allowed_version(spec: str, version: str) -> bool:
"""Check `spec` satisfies `version` or not.