summaryrefslogtreecommitdiff
path: root/sphinx/ext/autodoc.py
diff options
context:
space:
mode:
Diffstat (limited to 'sphinx/ext/autodoc.py')
-rw-r--r--sphinx/ext/autodoc.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/sphinx/ext/autodoc.py b/sphinx/ext/autodoc.py
index 6c796eec0..b0657dc9e 100644
--- a/sphinx/ext/autodoc.py
+++ b/sphinx/ext/autodoc.py
@@ -866,7 +866,7 @@ class DocstringSignatureMixin(object):
"""
def _find_signature(self, encoding=None):
- docstrings = Documenter.get_doc(self, encoding, 2)
+ docstrings = Documenter.get_doc(self, encoding)
if len(docstrings) != 1:
return
doclines = docstrings[0]
@@ -881,6 +881,9 @@ class DocstringSignatureMixin(object):
# the base name must match ours
if not self.objpath or base != self.objpath[-1]:
return
+ # re-prepare docstring to ignore indentation after signature
+ docstrings = Documenter.get_doc(self, encoding, 2)
+ doclines = docstrings[0]
# ok, now jump over remaining empty lines and set the remaining
# lines as the new doclines
i = 1