1
0
forked from VimPlug/jedi

Small issue with relative imports that don't contain a path after from.

This commit is contained in:
Dave Halter
2014-11-19 15:22:18 +01:00
parent aeaf073ca2
commit 08bdcfb8ca
3 changed files with 7 additions and 5 deletions

View File

@@ -1145,9 +1145,11 @@ class ImportFrom(Import):
for n in self.children[1:]:
if n not in ('.', '...'):
break
if is_node(n, 'dotted_name'):
if is_node(n, 'dotted_name'): # from x.y import
dotted = n.children[::2]
else:
elif n == 'import': # from . import
dotted = []
else: # from x import
dotted = [n]
return [dotted + [name] for name, alias in self._as_name_tuples()]