diff options
author | Takeshi KOMIYA <i.tkomiya@gmail.com> | 2019-06-15 16:45:17 +0900 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-06-15 16:45:17 +0900 |
commit | f6dfab33d29cd389c791acf5821adf556df5ca17 (patch) | |
tree | 07ecbae0a006a51567648553cfaa1f03fe6cbdc4 /sphinx/pycode/parser.py | |
parent | 8fd817d174aed3c6655190f904b89f6f7f2ec099 (diff) | |
parent | 5cf84a5505a6063b48e7fcc4d489259ade526912 (diff) | |
download | sphinx-git-f6dfab33d29cd389c791acf5821adf556df5ca17.tar.gz |
Merge branch '2.0' into refactor_todo2
Diffstat (limited to 'sphinx/pycode/parser.py')
-rw-r--r-- | sphinx/pycode/parser.py | 11 |
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.""" |