forked from VimPlug/jedi
Remove a get_definition usage.
This commit is contained in:
@@ -340,12 +340,10 @@ class Evaluator(object):
|
|||||||
"""
|
"""
|
||||||
if atom.type == 'name':
|
if atom.type == 'name':
|
||||||
# This is the first global lookup.
|
# This is the first global lookup.
|
||||||
stmt = atom.get_definition()
|
stmt = tree.search_ancestor(
|
||||||
if stmt.type == 'comp_for':
|
atom, 'expr_stmt', 'lambdef'
|
||||||
stmt = tree.search_ancestor(stmt, 'expr_stmt', 'lambdef', 'funcdef', 'classdef')
|
) or atom
|
||||||
if stmt is None or stmt.type != 'expr_stmt':
|
if stmt.type == 'lambdef':
|
||||||
# We only need to adjust the start_pos for statements, because
|
|
||||||
# there the name cannot be used.
|
|
||||||
stmt = atom
|
stmt = atom
|
||||||
return context.py__getattribute__(
|
return context.py__getattribute__(
|
||||||
name_or_str=atom,
|
name_or_str=atom,
|
||||||
|
|||||||
Reference in New Issue
Block a user