summaryrefslogtreecommitdiff
path: root/as_string.py
diff options
context:
space:
mode:
Diffstat (limited to 'as_string.py')
-rw-r--r--as_string.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/as_string.py b/as_string.py
index 72c5b6c3..1863b937 100644
--- a/as_string.py
+++ b/as_string.py
@@ -429,7 +429,11 @@ class AsStringVisitor(object):
def visit_yield(self, node):
"""yield an ast.Yield node as string"""
yi_val = node.value and (" " + node.value.accept(self)) or ""
- expr = 'yield' + yi_val
+ if node.yield_from:
+ yield_ = 'yield from'
+ else:
+ yield_ = 'yield'
+ expr = yield_ + yi_val
if node.parent.is_statement:
return expr
else: