1
0
forked from VimPlug/jedi

By trying to get rid of search_name in usages, we had to fix an issue with imports:

If used like 'follow(is_goto)', it could return a ModuleWrapper instead of a Name, which is what we actually want.
This commit is contained in:
Dave Halter
2014-09-03 19:30:00 +02:00
parent 59578966cf
commit 18204c4c19
5 changed files with 25 additions and 13 deletions

View File

@@ -455,11 +455,12 @@ class SubModule(Scope, Module):
else:
sep = (re.escape(os.path.sep),) * 2
r = re.search(r'([^%s]*?)(%s__init__)?(\.py|\.so)?$' % sep, self.path)
# remove PEP 3149 names
# Remove PEP 3149 names
string = re.sub('\.[a-z]+-\d{2}[mud]{0,3}$', '', r.group(1))
# positions are not real therefore choose (0, 0)
names = [(string, (0, 0))]
return Name(self, names, (0, 0), (0, 0), self.use_as_parent)
# Positions are not real, but a module starts at (1, 0)
p = (1, 0)
names = [(string, p)]
return Name(self, names, p, p, self.use_as_parent)
@property
def has_explicit_absolute_import(self):