1.1 --- a/micropython/ast.py Sun Jun 07 21:17:59 2009 +0200
1.2 +++ b/micropython/ast.py Sun Jun 07 22:55:59 2009 +0200
1.3 @@ -757,7 +757,10 @@
1.4 self._doCallFunc(temp_target, target)
1.5 self._endCallFunc(temp_target, target, temp_context)
1.6
1.7 - temp_iterator = self.optimiser.optimise_temp_storage()
1.8 + # Use a long-lasting temporary storage slot, since any result from the
1.9 + # __iter__ method will not remain around for long.
1.10 +
1.11 + temp_iterator = self.get_temp()
1.12
1.13 # In the loop...
1.14
1.15 @@ -806,7 +809,6 @@
1.16 # After the handler, clear the exception.
1.17
1.18 self.set_block(end_handler_block)
1.19 - self.new_op(ClearException())
1.20
1.21 # Assign to the target.
1.22
1.23 @@ -826,13 +828,19 @@
1.24 # Produce the "else" section.
1.25
1.26 if node.else_ is not None:
1.27 - self.set_block(exit_block)
1.28 -
1.29 + self.set_block(else_block)
1.30 + self.new_op(ClearException())
1.31 self.dispatch(node.else_)
1.32
1.33 - # After the loop...
1.34 + # After the loop...
1.35 +
1.36 + self.set_block(exit_block)
1.37
1.38 - self.set_block(exit_block)
1.39 + else:
1.40 + # After the loop...
1.41 +
1.42 + self.set_block(exit_block)
1.43 + self.new_op(ClearException())
1.44
1.45 # Compilation duties...
1.46