summaryrefslogtreecommitdiff
path: root/sphinx/ext/autodoc/deprecated.py
diff options
context:
space:
mode:
authorTakeshi KOMIYA <i.tkomiya@gmail.com>2020-11-28 13:47:23 +0900
committerTakeshi KOMIYA <i.tkomiya@gmail.com>2020-11-29 12:24:10 +0900
commitbb63f030346829d05997efc3ec4713b3c937f3d5 (patch)
tree5b217b29ad93cd94021909909d7dd29229003956 /sphinx/ext/autodoc/deprecated.py
parentc15c61ed64b3c9e0232fe07a366c98aa229e6286 (diff)
downloadsphinx-git-bb63f030346829d05997efc3ec4713b3c937f3d5.tar.gz
Fix #8503: autoattribute could not create document for a GenericAlias
Diffstat (limited to 'sphinx/ext/autodoc/deprecated.py')
-rw-r--r--sphinx/ext/autodoc/deprecated.py15
1 files changed, 15 insertions, 0 deletions
diff --git a/sphinx/ext/autodoc/deprecated.py b/sphinx/ext/autodoc/deprecated.py
index c6ca13105..5541a7a91 100644
--- a/sphinx/ext/autodoc/deprecated.py
+++ b/sphinx/ext/autodoc/deprecated.py
@@ -109,3 +109,18 @@ class SlotsAttributeDocumenter(AttributeDocumenter):
warnings.warn("%s is deprecated." % self.__class__.__name__,
RemovedInSphinx50Warning, stacklevel=2)
super().__init__(*args, **kwargs)
+
+
+class GenericAliasDocumenter(DataDocumenter):
+ """
+ Specialized Documenter subclass for GenericAliases.
+ """
+
+ objtype = 'genericalias'
+ directivetype = 'data'
+ priority = DataDocumenter.priority + 1 # type: ignore
+
+ def __init__(self, *args: Any, **kwargs: Any) -> None:
+ warnings.warn("%s is deprecated." % self.__class__.__name__,
+ RemovedInSphinx50Warning, stacklevel=2)
+ super().__init__(*args, **kwargs)