From 7aab8c3b07653cceeea534bf536eb8bee2bb7f61 Mon Sep 17 00:00:00 2001 From: Takeshi KOMIYA Date: Mon, 16 Oct 2017 22:33:38 +0900 Subject: Fix #4156: failed to parse class comment --- sphinx/pycode/parser.py | 1 + 1 file changed, 1 insertion(+) (limited to 'sphinx/pycode/parser.py') diff --git a/sphinx/pycode/parser.py b/sphinx/pycode/parser.py index d488842e9..9b5cb13c9 100644 --- a/sphinx/pycode/parser.py +++ b/sphinx/pycode/parser.py @@ -336,6 +336,7 @@ class VariableCommentPicker(ast.NodeVisitor): self.current_classes.append(node.name) self.add_entry(node.name) self.context.append(node.name) + self.previous = node for child in node.body: self.visit(child) self.context.pop() -- cgit v1.2.1