From a9d8f389a9252bf4b0ee19bb096ca17b8c8e7333 Mon Sep 17 00:00:00 2001 From: Dave Halter Date: Fri, 23 Aug 2019 20:56:00 +0200 Subject: [PATCH] Avoid using get_global_filters if it's not needed --- jedi/inference/syntax_tree.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/jedi/inference/syntax_tree.py b/jedi/inference/syntax_tree.py index 72f43b78..979bf1cb 100644 --- a/jedi/inference/syntax_tree.py +++ b/jedi/inference/syntax_tree.py @@ -572,10 +572,9 @@ def tree_name_to_values(inference_state, context, tree_name): if node.type == 'global_stmt': c = context.create_context(tree_name) finder = NameFinder(inference_state, c, c, tree_name.value) - filters = finder.get_global_filters() # For global_stmt lookups, we only need the first possible scope, # which means the function itself. - filters = [next(filters)] + filters = [next(c.get_filters())] return finder.find(filters, attribute_lookup=False) elif node.type not in ('import_from', 'import_name'): c = context.create_context(tree_name)