Remove an if that was unnecessary

This commit is contained in:
Dave Halter
2019-04-12 12:59:21 +02:00
parent 0bf4bf36f0
commit 201cf880f9

View File

@@ -259,11 +259,9 @@ def get_parent_scope(node, include_flows=False):
return None # It's a module already. return None # It's a module already.
if scope.type in ('funcdef', 'classdef') and scope.name == node: if scope.type in ('funcdef', 'classdef') and scope.name == node:
scope = scope.parent scope = scope.parent
if scope.parent is None: # The module scope.
return scope
while True: while True:
if include_flows and isinstance(scope, tree.Flow) or is_scope(scope): if is_scope(scope) or include_flows and isinstance(scope, tree.Flow):
return scope return scope
scope = scope.parent scope = scope.parent
return scope return scope