1
0
forked from VimPlug/jedi

fixed more import problems (also with the import usage), definitely fixes davidhalter/jedi-vim#152

This commit is contained in:
David Halter
2013-08-07 10:24:28 +04:30
parent f72816a702
commit c6e08221ce
4 changed files with 15 additions and 8 deletions
+6 -4
View File
@@ -153,14 +153,16 @@ class ImportPath(pr.Base):
return pr.Name(self.GlobalNamespace, [(name, inf_pos)],
inf_pos, inf_pos, self.import_stmt)
if not search_path:
search_path = self.sys_path_with_modifications()
names = []
inf_pos = float('inf'), float('inf')
# add builtin module names
if search_path is None:
names += [generate_name(name) for name in sys.builtin_module_names]
if search_path is None:
search_path = self.sys_path_with_modifications()
for module_loader, name, is_pkg in pkgutil.iter_modules(search_path):
names.append(generate_name(name))
# add builtin module names
names += [generate_name(name) for name in sys.builtin_module_names]
return names
def sys_path_with_modifications(self):