Skip to content

Commit

Permalink
Fix yield from in python 3.
Browse files Browse the repository at this point in the history
  • Loading branch information
davidhalter committed Dec 3, 2016
1 parent 760f900 commit 69c23ac
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions jedi/evaluate/representation.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@
not exist.
py__package__() Only on modules. For the import system.
py__path__() Only on modules. For the import system.
py__get__(call_object) Only on instances. Simulates
descriptors.
====================================== ========================================
__
Expand Down Expand Up @@ -360,9 +362,8 @@ def get_return_values(self, check_yields=False):

def _eval_yield(self, yield_expr):
node = yield_expr.children[1]
if node.type == 'yield_arg':
# It must be a yield from.
yield_from_types = self.eval_node(node)
if node.type == 'yield_arg': # It must be a yield from.
yield_from_types = self.eval_node(node.children[1])
for lazy_context in iterable.py__iter__(self.evaluator, yield_from_types, node):
yield lazy_context
else:
Expand Down

0 comments on commit 69c23ac

Please sign in to comment.