From 201cf880f9a3fb7362c951e49824434ced433340 Mon Sep 17 00:00:00 2001 From: Dave Halter Date: Fri, 12 Apr 2019 12:59:21 +0200 Subject: [PATCH] Remove an if that was unnecessary --- jedi/parser_utils.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/jedi/parser_utils.py b/jedi/parser_utils.py index c8998fa4..1a68ca4a 100644 --- a/jedi/parser_utils.py +++ b/jedi/parser_utils.py @@ -259,11 +259,9 @@ def get_parent_scope(node, include_flows=False): return None # It's a module already. if scope.type in ('funcdef', 'classdef') and scope.name == node: scope = scope.parent - if scope.parent is None: # The module scope. - return scope 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 scope = scope.parent return scope