1
0
forked from VimPlug/jedi

Fix issues with yield.

This commit is contained in:
Dave Halter
2017-09-01 18:38:19 +02:00
parent e2d53f51b0
commit c47f5ca68c
4 changed files with 34 additions and 2 deletions

View File

@@ -342,6 +342,11 @@ class FunctionExecutionContext(context.TreeContext):
return types
def _eval_yield(self, yield_expr):
if yield_expr.type == 'keyword':
# `yield` just yields None.
yield context.LazyKnownContext(compiled.create(self.evaluator, None))
return
node = yield_expr.children[1]
if node.type == 'yield_arg': # It must be a yield from.
cn = ContextualizedNode(self, node.children[1])