diff options
author | Marion <marion.zepf@gmail.com> | 2013-09-04 09:59:12 (GMT) |
---|---|---|
committer | Marion <marion.zepf@gmail.com> | 2013-09-04 09:59:12 (GMT) |
commit | 7a177e8e11d28282f2e9b34f4869a4adc05cf71b (patch) | |
tree | 3d37dab08fe812a643376cbf356f085d80fe03a3 | |
parent | 795c89415ea2f79ddb52ca287c682717a6781829 (diff) |
avoid double 'yield True' in the exported code
-rw-r--r-- | TurtleArt/taexportpython.py | 3 |
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)) |