diff options
-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 35365ac..0d1e27a 100644 --- a/TurtleArt/taexportpython.py +++ b/TurtleArt/taexportpython.py @@ -209,7 +209,8 @@ def _walk_action_stack(top_block, lc, convert_me=True): # body of conditional or loop new_arg_asts = _walk_action_stack(conn, lc, convert_me=convert_me) - if prim == LogoCode.prim_loop: + if (prim == LogoCode.prim_loop and + not isinstance(new_arg_asts[-1], ast.Yield)): new_arg_asts.append(ast_yield_true()) arg_asts.append(new_arg_asts) else: |