Fix flow's AttributeError detection.

This commit is contained in:
Dave Halter
2014-12-11 19:26:49 +01:00
parent d11ea73ef4
commit c3106c10ef
2 changed files with 5 additions and 11 deletions

View File

@@ -632,7 +632,7 @@ class Script(object):
if node.type == 'expr_stmt':
check_types(self._evaluator.eval_statement(node))
else:
self._evaluator.eval_element(node)
check_types(self._evaluator.eval_element(node))
for dec_func in decorated_funcs:
er.Function(self._evaluator, dec_func).get_decorated_func()

View File

@@ -220,16 +220,6 @@ def get_module_statements(module):
def add_stmts(stmts):
new = set()
for stmt in stmts:
if isinstance(stmt, pr.Flow):
while stmt is not None:
new |= add_stmts(stmt.inputs)
stmt = stmt.next
continue
stmt = stmt.stmt
if stmt is None:
continue
if stmt.type == 'expr_stmt':
new.add(stmt)
@@ -250,6 +240,10 @@ def get_module_statements(module):
nodes |= add_stmts(scope.statements)
nodes |= add_stmts(r for r in scope.returns if r is not None)
for flow in scope.flows:
if flow.type == 'for_stmt':
nodes.add(flow.children[3])
try:
decorators = scope.get_decorators()
except AttributeError: