autodoc: fix annotation None for properties

This is a follow-up for pull request #109
/ bdb3fadacd96cc9019440f2b3aad74f9c72b0500
This commit is contained in:
Johannes Dewender 2013-10-09 15:14:14 +02:00
parent 313559116d
commit 2e07e7dc25

View File

@ -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: