mirror of
https://github.com/davidhalter/jedi.git
synced 2025-12-07 14:34:31 +08:00
Remove an if that was unnecessary
This commit is contained in:
@@ -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
|
||||||
|
|||||||
Reference in New Issue
Block a user