diff --git a/sphinx/ext/autodoc/importer.py b/sphinx/ext/autodoc/importer.py index 427fae7d6..8513255c1 100644 --- a/sphinx/ext/autodoc/importer.py +++ b/sphinx/ext/autodoc/importer.py @@ -11,7 +11,7 @@ import importlib import traceback import warnings -from typing import Any, Callable, Dict, List, Mapping, NamedTuple, Optional, Tuple +from typing import Any, Callable, Dict, List, NamedTuple, Optional, Tuple from sphinx.pycode import ModuleAnalyzer from sphinx.util import logging @@ -173,12 +173,6 @@ def _getmro(obj: Any) -> Tuple["Type", ...]: return tuple() -def _getannotations(obj: Any) -> Mapping[str, Any]: - warnings.warn('sphinx.ext.autodoc.importer._getannotations() is deprecated.', - RemovedInSphinx40Warning) - return getannotations(obj) - - def get_object_members(subject: Any, objpath: List[str], attrgetter: Callable, analyzer: ModuleAnalyzer = None) -> Dict[str, Attribute]: """Get members and attributes of target object.""" diff --git a/sphinx/pycode/__init__.py b/sphinx/pycode/__init__.py index 718380881..d69ab64bd 100644 --- a/sphinx/pycode/__init__.py +++ b/sphinx/pycode/__init__.py @@ -10,6 +10,7 @@ import re import tokenize +import warnings from collections import OrderedDict from importlib import import_module from inspect import Signature