1
0
forked from VimPlug/jedi

Fix tests for defined_names + full_name

This commit is contained in:
Takafumi Arakaki
2013-05-21 13:49:23 +02:00
parent 5d6719ed8c
commit 851238386f

View File

@@ -142,11 +142,19 @@ class BaseDefinition(object):
def path(self):
"""The module path."""
path = []
def insert_nonnone(x):
if x:
path.insert(0, x)
if not isinstance(self._definition, keywords.Keyword):
par = self._definition
with common.ignored(AttributeError):
path.append(par.alias)
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):
path.insert(0, par.name)
par = par.parent