From a86346aca6bf99a8920da366caaad7c47809ecce Mon Sep 17 00:00:00 2001 From: Takeshi KOMIYA Date: Sat, 7 Mar 2020 20:43:25 +0900 Subject: Remove deprecated features marked as RemovedInSphinx40Warning --- sphinx/util/docfields.py | 23 +---------------------- 1 file changed, 1 insertion(+), 22 deletions(-) (limited to 'sphinx/util/docfields.py') diff --git a/sphinx/util/docfields.py b/sphinx/util/docfields.py index 561271c4f..cb11a799d 100644 --- a/sphinx/util/docfields.py +++ b/sphinx/util/docfields.py @@ -9,7 +9,6 @@ :license: BSD, see LICENSE for details. """ -import warnings from typing import Any, Dict, List, Tuple, Type, Union from typing import TYPE_CHECKING, cast @@ -17,7 +16,6 @@ from docutils import nodes from docutils.nodes import Node from sphinx import addnodes -from sphinx.deprecation import RemovedInSphinx40Warning from sphinx.util.typing import TextlikeNode if TYPE_CHECKING: @@ -217,26 +215,7 @@ class DocFieldTransformer: def __init__(self, directive: "ObjectDescription") -> None: self.directive = directive - try: - self.typemap = directive.get_field_type_map() - except Exception: - # for 3rd party extensions directly calls this transformer. - warnings.warn('DocFieldTransformer expects given directive object is a subclass ' - 'of ObjectDescription.', RemovedInSphinx40Warning) - self.typemap = self.preprocess_fieldtypes(directive.__class__.doc_field_types) - - def preprocess_fieldtypes(self, types: List[Field]) -> Dict[str, Tuple[Field, bool]]: - warnings.warn('DocFieldTransformer.preprocess_fieldtypes() is deprecated.', - RemovedInSphinx40Warning) - typemap = {} - for fieldtype in types: - for name in fieldtype.names: - typemap[name] = fieldtype, False - if fieldtype.is_typed: - typed_field = cast(TypedField, fieldtype) - for name in typed_field.typenames: - typemap[name] = typed_field, True - return typemap + self.typemap = directive.get_field_type_map() def transform_all(self, node: addnodes.desc_content) -> None: """Transform all field list children of a node.""" -- cgit v1.2.1