summaryrefslogtreecommitdiff
path: root/sphinx/ext/autodoc.py
diff options
context:
space:
mode:
authorGeorg Brandl <georg@python.org>2011-01-03 15:55:30 +0100
committerGeorg Brandl <georg@python.org>2011-01-03 15:55:30 +0100
commit69e5b91b2daa147e01fe4f497086639dc69f392b (patch)
tree38fbdaba2e2901979a7df2a8b52c9befe7206a54 /sphinx/ext/autodoc.py
parent13ebda2b76ba37e7684445bb23a00d233a33d6a0 (diff)
downloadsphinx-git-69e5b91b2daa147e01fe4f497086639dc69f392b.tar.gz
Fix strange reportings of line numbers for warnings generated from
autodoc-included docstrings, due to different behavior depending on docutils version.
Diffstat (limited to 'sphinx/ext/autodoc.py')
-rw-r--r--sphinx/ext/autodoc.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/sphinx/ext/autodoc.py b/sphinx/ext/autodoc.py
index 55253e8ab..f2f872ef7 100644
--- a/sphinx/ext/autodoc.py
+++ b/sphinx/ext/autodoc.py
@@ -107,7 +107,7 @@ class AutodocReporter(object):
return getattr(self.reporter, name)
def system_message(self, level, message, *children, **kwargs):
- if 'line' in kwargs:
+ if 'line' in kwargs and 'source' not in kwargs:
try:
source, line = self.viewlist.items[kwargs['line']]
except IndexError:
@@ -676,7 +676,7 @@ class Documenter(object):
# make sure that the result starts with an empty line. This is
# necessary for some situations where another directive preprocesses
# reST and no starting newline is present
- self.add_line(u'', '')
+ self.add_line(u'', '<autodoc>')
# format the object's signature, if any
sig = self.format_signature()