summaryrefslogtreecommitdiff
path: root/sphinx/ext/autodoc.py
diff options
context:
space:
mode:
authorGeorg Brandl <georg@python.org>2011-01-04 00:35:27 +0100
committerGeorg Brandl <georg@python.org>2011-01-04 00:35:27 +0100
commit3642b521ed5a8c85faf4b37eb1bc83d6cfa63716 (patch)
treeeed02f129e674a183307a35cd383b9c6f369b6bf /sphinx/ext/autodoc.py
parent8fd5bd1e1909ac5c5e857049dafcdcc2975eb90d (diff)
parenteecd8bff03e6617dc3644e319f9447e3320af9c3 (diff)
downloadsphinx-git-3642b521ed5a8c85faf4b37eb1bc83d6cfa63716.tar.gz
merge with 1.0
Diffstat (limited to 'sphinx/ext/autodoc.py')
-rw-r--r--sphinx/ext/autodoc.py11
1 files changed, 8 insertions, 3 deletions
diff --git a/sphinx/ext/autodoc.py b/sphinx/ext/autodoc.py
index b61e606aa..a1dfeb1f2 100644
--- a/sphinx/ext/autodoc.py
+++ b/sphinx/ext/autodoc.py
@@ -461,6 +461,11 @@ class Documenter(object):
if not no_docstring:
encoding = self.analyzer and self.analyzer.encoding
docstrings = self.get_doc(encoding)
+ if not docstrings:
+ # append at least a dummy docstring, so that the event
+ # autodoc-process-docstring is fired and can add some
+ # content if desired
+ docstrings.append([])
for i, line in enumerate(self.process_doc(docstrings)):
self.add_line(line, sourcename, i)
@@ -982,9 +987,9 @@ class ClassDocumenter(ModuleLevelDocumenter):
content = self.env.config.autoclass_content
docstrings = []
- docstring = self.get_attr(self.object, '__doc__', None)
- if docstring:
- docstrings.append(docstring)
+ attrdocstring = self.get_attr(self.object, '__doc__', None)
+ if attrdocstring:
+ docstrings.append(attrdocstring)
# for classes, what the "docstring" is can be controlled via a
# config value; the default is only the class docstring