1
0
forked from VimPlug/jedi

Fix try/except checks in static analysis.

This commit is contained in:
Dave Halter
2014-12-12 02:26:16 +01:00
parent c3106c10ef
commit 8eaa008b5f
2 changed files with 50 additions and 25 deletions

View File

@@ -955,6 +955,17 @@ class ForStmt(Flow):
class TryStmt(Flow):
type = 'try_stmt'
def except_clauses(self):
"""
Returns the ``test`` nodes found in ``except_clause`` nodes.
Returns ``[None]`` for except clauses without an exception given.
"""
for node in self.children:
if node.type == 'except_clause':
yield node.children[1]
elif node == 'except':
yield None
class WithStmt(Flow):
type = 'with_stmt'