From bb63f030346829d05997efc3ec4713b3c937f3d5 Mon Sep 17 00:00:00 2001 From: Takeshi KOMIYA Date: Sat, 28 Nov 2020 13:47:23 +0900 Subject: Fix #8503: autoattribute could not create document for a GenericAlias --- sphinx/ext/autodoc/deprecated.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'sphinx/ext/autodoc/deprecated.py') 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) -- cgit v1.2.1