forked from VimPlug/jedi
Few import issues.
This commit is contained in:
@@ -484,8 +484,8 @@ class Parser(object):
|
|||||||
if len(from_names) == 1 and str(from_names[0]) == 'import' and relative_count:
|
if len(from_names) == 1 and str(from_names[0]) == 'import' and relative_count:
|
||||||
self._gen.push_last_back()
|
self._gen.push_last_back()
|
||||||
tok_str = 'import'
|
tok_str = 'import'
|
||||||
names = []
|
from_names = []
|
||||||
if not names and not relative_count or tok_str != "import":
|
if not from_names and not relative_count or tok_str != "import":
|
||||||
debug.warning("from: syntax error@%s", tok.start_pos[0])
|
debug.warning("from: syntax error@%s", tok.start_pos[0])
|
||||||
defunct = True
|
defunct = True
|
||||||
if tok_str != 'import':
|
if tok_str != 'import':
|
||||||
|
|||||||
@@ -477,7 +477,7 @@ class SubModule(Scope, Module):
|
|||||||
is a ``__future__`` import.
|
is a ``__future__`` import.
|
||||||
"""
|
"""
|
||||||
for imp in self.imports:
|
for imp in self.imports:
|
||||||
if imp.from_ns is None or imp.namespace_names is None:
|
if imp.from_names is None or imp.namespace_names is None:
|
||||||
continue
|
continue
|
||||||
|
|
||||||
namespace, feature = imp.from_names[0], imp.namespace_names[0]
|
namespace, feature = imp.from_names[0], imp.namespace_names[0]
|
||||||
@@ -822,9 +822,9 @@ class Import(Simple):
|
|||||||
if self.alias:
|
if self.alias:
|
||||||
return [self.alias]
|
return [self.alias]
|
||||||
if len(self.namespace_names) > 1:
|
if len(self.namespace_names) > 1:
|
||||||
return self.namespace_names[0]
|
return [self.namespace_names[0]]
|
||||||
else:
|
else:
|
||||||
return [self.namespace_names]
|
return self.namespace_names
|
||||||
|
|
||||||
def get_all_import_names(self):
|
def get_all_import_names(self):
|
||||||
n = []
|
n = []
|
||||||
|
|||||||
Reference in New Issue
Block a user