mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
autodoc: fix annotation None for properties
This is a follow-up for pull request #109 / bdb3fadacd96cc9019440f2b3aad74f9c72b0500
This commit is contained in:
parent
313559116d
commit
2e07e7dc25
@ -1252,13 +1252,14 @@ class AttributeDocumenter(ClassLevelDocumenter):
|
|||||||
|
|
||||||
def add_directive_header(self, sig):
|
def add_directive_header(self, sig):
|
||||||
ClassLevelDocumenter.add_directive_header(self, sig)
|
ClassLevelDocumenter.add_directive_header(self, sig)
|
||||||
if not self._datadescriptor and not self.options.annotation:
|
if not self.options.annotation:
|
||||||
try:
|
if not self._datadescriptor:
|
||||||
objrepr = safe_repr(self.object)
|
try:
|
||||||
except ValueError:
|
objrepr = safe_repr(self.object)
|
||||||
pass
|
except ValueError:
|
||||||
else:
|
pass
|
||||||
self.add_line(u' :annotation: = ' + objrepr, '<autodoc>')
|
else:
|
||||||
|
self.add_line(u' :annotation: = ' + objrepr, '<autodoc>')
|
||||||
elif self.options.annotation is SUPPRESS:
|
elif self.options.annotation is SUPPRESS:
|
||||||
pass
|
pass
|
||||||
else:
|
else:
|
||||||
|
Loading…
Reference in New Issue
Block a user