Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarion <marion.zepf@gmail.com>2013-09-04 09:59:12 (GMT)
committer Marion <marion.zepf@gmail.com>2013-09-04 09:59:12 (GMT)
commit7a177e8e11d28282f2e9b34f4869a4adc05cf71b (patch)
tree3d37dab08fe812a643376cbf356f085d80fe03a3
parent795c89415ea2f79ddb52ca287c682717a6781829 (diff)
avoid double 'yield True' in the exported code
-rw-r--r--TurtleArt/taexportpython.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/TurtleArt/taexportpython.py b/TurtleArt/taexportpython.py
index 405e683..35365ac 100644
--- a/TurtleArt/taexportpython.py
+++ b/TurtleArt/taexportpython.py
@@ -107,7 +107,8 @@ def _action_stack_to_python(block, lc, name="start"):
name -- the name of the action stack (defaults to "start") """
# traverse the block stack and get the AST for every block
ast_list = _walk_action_stack(block, lc)
- ast_list.append(ast_yield_true())
+ if not isinstance(ast_list[-1], ast.Yield):
+ ast_list.append(ast_yield_true())
action_stack_ast = ast.Module(body=ast_list)
#debug_output(str(action_stack_ast))