Commits

Georg Brandl  committed a4109c7 Merge

Merged in JonnyJD/sphinx-fix-none-property (pull request #179)

autodoc: fix annotation None for properties

  • Participants
  • Parent commits 07ad4d4, f89d291

Comments (0)

Files changed (1)

File sphinx/ext/autodoc.py

 
     def add_directive_header(self, sig):
         ClassLevelDocumenter.add_directive_header(self, sig)
-        if not self._datadescriptor and not self.options.annotation:
-            try:
-                objrepr = safe_repr(self.object)
-            except ValueError:
-                pass
-            else:
-                self.add_line(u'   :annotation: = ' + objrepr, '<autodoc>')
+        if not self.options.annotation:
+            if not self._datadescriptor:
+                try:
+                    objrepr = safe_repr(self.object)
+                except ValueError:
+                    pass
+                else:
+                    self.add_line(u'   :annotation: = ' + objrepr, '<autodoc>')
         elif self.options.annotation is SUPPRESS:
             pass
         else: