forked from VimPlug/jedi
tests working all again, with weakref parents
This commit is contained in:
19
functions.py
19
functions.py
@@ -71,6 +71,14 @@ class Definition(object):
|
||||
""" The definition of a function """
|
||||
self.definition = definition
|
||||
|
||||
par = self.definition
|
||||
while True:
|
||||
if par.parent() is not None:
|
||||
par = par.parent()
|
||||
else:
|
||||
break
|
||||
self.module_path = str(par.path)
|
||||
|
||||
def get_name(self):
|
||||
try:
|
||||
# is a func / class
|
||||
@@ -91,17 +99,6 @@ class Definition(object):
|
||||
except ValueError:
|
||||
return path
|
||||
|
||||
@property
|
||||
def module_path(self):
|
||||
par = self.definition
|
||||
while True:
|
||||
if par.parent() is not None:
|
||||
par = par.parent()
|
||||
else:
|
||||
break
|
||||
|
||||
return str(par.path)
|
||||
|
||||
def in_builtin_module(self):
|
||||
return not self.module_path.endswith('.py')
|
||||
|
||||
|
||||
Reference in New Issue
Block a user