diff options
author | Takeshi KOMIYA <i.tkomiya@gmail.com> | 2020-11-28 13:47:23 +0900 |
---|---|---|
committer | Takeshi KOMIYA <i.tkomiya@gmail.com> | 2020-11-29 12:24:10 +0900 |
commit | bb63f030346829d05997efc3ec4713b3c937f3d5 (patch) | |
tree | 5b217b29ad93cd94021909909d7dd29229003956 /sphinx/ext/autodoc/deprecated.py | |
parent | c15c61ed64b3c9e0232fe07a366c98aa229e6286 (diff) | |
download | sphinx-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.py | 15 |
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) |