summaryrefslogtreecommitdiff
path: root/sphinx/pycode
diff options
context:
space:
mode:
authorGeorg Brandl <georg@python.org>2008-12-29 22:30:00 +0100
committerGeorg Brandl <georg@python.org>2008-12-29 22:30:00 +0100
commitc5bd95ae02352a05a3899b0cbad8a85a95804935 (patch)
tree3db2a6af417ddc0a3ad331bbbdc99f9325436f27 /sphinx/pycode
parente51906609b6959386593da6fa2ede65ca9129b62 (diff)
downloadsphinx-c5bd95ae02352a05a3899b0cbad8a85a95804935.tar.gz
Another fix for DEDENT/INDENT handling.
Diffstat (limited to 'sphinx/pycode')
-rw-r--r--sphinx/pycode/__init__.py1
-rw-r--r--sphinx/pycode/pytree.py4
2 files changed, 3 insertions, 2 deletions
diff --git a/sphinx/pycode/__init__.py b/sphinx/pycode/__init__.py
index ab34af1c..dd32d470 100644
--- a/sphinx/pycode/__init__.py
+++ b/sphinx/pycode/__init__.py
@@ -77,6 +77,7 @@ class ClassAttrVisitor(pytree.NodeVisitor):
pnode = pnode.get_prev_leaf()
if not pnode or pnode.type not in (token.INDENT, token.DEDENT):
break
+ prefix = pnode.get_prefix()
docstring = prepare_commentdoc(prefix)
if not docstring:
return
diff --git a/sphinx/pycode/pytree.py b/sphinx/pycode/pytree.py
index bd72bc99..46017a95 100644
--- a/sphinx/pycode/pytree.py
+++ b/sphinx/pycode/pytree.py
@@ -221,8 +221,8 @@ class Leaf(Base):
self.prefix = prefix
def __repr__(self):
- return "%s(%r, %r)" % (self.__class__.__name__,
- self.type, self.value)
+ return "%s(%r, %r, %r)" % (self.__class__.__name__,
+ self.type, self.value, self.prefix)
def __str__(self):
"""This reproduces the input source exactly."""