forked from VimPlug/jedi
Fix tests for defined_names + full_name
This commit is contained in:
@@ -142,11 +142,19 @@ class BaseDefinition(object):
|
|||||||
def path(self):
|
def path(self):
|
||||||
"""The module path."""
|
"""The module path."""
|
||||||
path = []
|
path = []
|
||||||
|
|
||||||
|
def insert_nonnone(x):
|
||||||
|
if x:
|
||||||
|
path.insert(0, x)
|
||||||
|
|
||||||
if not isinstance(self._definition, keywords.Keyword):
|
if not isinstance(self._definition, keywords.Keyword):
|
||||||
par = self._definition
|
par = self._definition
|
||||||
with common.ignored(AttributeError):
|
|
||||||
path.append(par.alias)
|
|
||||||
while par is not None:
|
while par is not None:
|
||||||
|
if isinstance(par, pr.Import):
|
||||||
|
insert_nonnone(par.namespace)
|
||||||
|
insert_nonnone(par.from_ns)
|
||||||
|
if par.relative_count == 0:
|
||||||
|
break
|
||||||
with common.ignored(AttributeError):
|
with common.ignored(AttributeError):
|
||||||
path.insert(0, par.name)
|
path.insert(0, par.name)
|
||||||
par = par.parent
|
par = par.parent
|
||||||
|
|||||||
Reference in New Issue
Block a user