forked from VimPlug/jedi
Issues with imports.
This commit is contained in:
@@ -120,7 +120,7 @@ class Parser(object):
|
|||||||
tok = next(self._gen) if pre_used_token is None else pre_used_token
|
tok = next(self._gen) if pre_used_token is None else pre_used_token
|
||||||
|
|
||||||
if tok.type != tokenize.NAME and tok.string != '*':
|
if tok.type != tokenize.NAME and tok.string != '*':
|
||||||
return None, tok
|
return [], tok
|
||||||
|
|
||||||
append(tok)
|
append(tok)
|
||||||
while True:
|
while True:
|
||||||
@@ -493,9 +493,9 @@ class Parser(object):
|
|||||||
defunct = True
|
defunct = True
|
||||||
if tok_str != 'import':
|
if tok_str != 'import':
|
||||||
self._gen.push_last_back()
|
self._gen.push_last_back()
|
||||||
names = self._parse_import_list()
|
imports = self._parse_import_list()
|
||||||
for count, (names, alias, defunct2) in enumerate(names):
|
for count, (names, alias, defunct2) in enumerate(imports):
|
||||||
star = names and unicode(names) == '*'
|
star = names and unicode(names[-1]) == '*'
|
||||||
if star:
|
if star:
|
||||||
names = []
|
names = []
|
||||||
e = (alias or names and names[-1] or self._gen.previous).end_pos
|
e = (alias or names and names[-1] or self._gen.previous).end_pos
|
||||||
|
|||||||
@@ -494,7 +494,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_names is None or imp.namespace_names is None:
|
if not imp.from_names or not imp.namespace_names:
|
||||||
continue
|
continue
|
||||||
|
|
||||||
namespace, feature = imp.from_names[0], imp.namespace_names[0]
|
namespace, feature = imp.from_names[0], imp.namespace_names[0]
|
||||||
|
|||||||
Reference in New Issue
Block a user