Merge pull request #8625 from tk0miya/refactor_autodoc3

refactor: autodoc: Allow None value from get_doc()
This commit is contained in:
Takeshi KOMIYA 2021-01-01 13:08:36 +09:00 committed by GitHub
commit d82a3c2047
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1193,6 +1193,8 @@ class DocstringSignatureMixin:
valid_names.extend(cls.__name__ for cls in self.object.__mro__)
docstrings = self.get_doc()
if docstrings is None:
return None, None
self._new_docstrings = docstrings[:]
self._signatures = []
result = None
@ -2419,6 +2421,7 @@ class AttributeDocumenter(GenericAliasMixin, NewTypeMixin, SlotsMixin, # type:
return True
else:
doc = self.get_doc()
if doc:
metadata = extract_metadata('\n'.join(sum(doc, [])))
if 'hide-value' in metadata:
return True