Fix: flow analysis crashed when using in combination with different modules.

This commit is contained in:
Dave Halter
2015-12-17 12:37:26 +01:00
parent 3d79d0994e
commit 54b1b2be74
4 changed files with 28 additions and 2 deletions
+6 -1
View File
@@ -72,9 +72,14 @@ def _break_check(evaluator, stmt, base_scope, element_scope):
if reachable in (UNREACHABLE, UNSURE):
return reachable
if element_scope.type == 'file_input':
# The definition is in another module and therefore just return what we
# have generated.
return reachable
if base_scope != element_scope and base_scope != element_scope.parent:
return reachable & _break_check(evaluator, stmt, base_scope, element_scope.parent)
return reachable
else:
return reachable
def _check_if(evaluator, node):