summaryrefslogtreecommitdiff
path: root/sphinx/pycode/parser.py
diff options
context:
space:
mode:
authorTakeshi KOMIYA <i.tkomiya@gmail.com>2019-06-15 16:45:17 +0900
committerGitHub <noreply@github.com>2019-06-15 16:45:17 +0900
commitf6dfab33d29cd389c791acf5821adf556df5ca17 (patch)
tree07ecbae0a006a51567648553cfaa1f03fe6cbdc4 /sphinx/pycode/parser.py
parent8fd817d174aed3c6655190f904b89f6f7f2ec099 (diff)
parent5cf84a5505a6063b48e7fcc4d489259ade526912 (diff)
downloadsphinx-git-f6dfab33d29cd389c791acf5821adf556df5ca17.tar.gz
Merge branch '2.0' into refactor_todo2
Diffstat (limited to 'sphinx/pycode/parser.py')
-rw-r--r--sphinx/pycode/parser.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/sphinx/pycode/parser.py b/sphinx/pycode/parser.py
index f9489e91a..1746537bb 100644
--- a/sphinx/pycode/parser.py
+++ b/sphinx/pycode/parser.py
@@ -357,6 +357,17 @@ class VariableCommentPicker(ast.NodeVisitor):
except TypeError:
pass # this assignment is not new definition!
+ def visit_Try(self, node):
+ # type: (ast.Try) -> None
+ """Handles Try node and processes body and else-clause.
+
+ .. note:: pycode parser ignores objects definition in except-clause.
+ """
+ for subnode in node.body:
+ self.visit(subnode)
+ for subnode in node.orelse:
+ self.visit(subnode)
+
def visit_ClassDef(self, node):
# type: (ast.ClassDef) -> None
"""Handles ClassDef node and set context."""