1
0
forked from VimPlug/jedi

fixed a problem with 'None' returns

This commit is contained in:
David Halter
2013-04-28 21:19:05 +04:30
parent 4b36fb2f6f
commit 7ad156bde7

View File

@@ -136,7 +136,7 @@ class ParserNode(object):
el = module.imports[0]
except IndexError:
try:
el = module.returns[0]
el = [r for r in module.returns if r is not None][0]
except IndexError:
return self.parent.indent + 1
return el.start_pos[1]
@@ -149,6 +149,8 @@ class ParserNode(object):
items = getattr(parser.module, c)
if set_parent:
for i in items:
if i is None:
continue # happens with empty returns
i.parent = scope.use_as_parent
if isinstance(i, (pr.Function, pr.Class)):
for d in i.decorators: