forked from VimPlug/jedi
Avoid using get_global_filters if it's not needed
This commit is contained in:
@@ -572,10 +572,9 @@ def tree_name_to_values(inference_state, context, tree_name):
|
|||||||
if node.type == 'global_stmt':
|
if node.type == 'global_stmt':
|
||||||
c = context.create_context(tree_name)
|
c = context.create_context(tree_name)
|
||||||
finder = NameFinder(inference_state, c, c, tree_name.value)
|
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,
|
# For global_stmt lookups, we only need the first possible scope,
|
||||||
# which means the function itself.
|
# which means the function itself.
|
||||||
filters = [next(filters)]
|
filters = [next(c.get_filters())]
|
||||||
return finder.find(filters, attribute_lookup=False)
|
return finder.find(filters, attribute_lookup=False)
|
||||||
elif node.type not in ('import_from', 'import_name'):
|
elif node.type not in ('import_from', 'import_name'):
|
||||||
c = context.create_context(tree_name)
|
c = context.create_context(tree_name)
|
||||||
|
|||||||
Reference in New Issue
Block a user