changeset 96:a851461d345e

Iterate over a copy of the loop when changing it
author Neil Muller <drnlmuller@gmail.com>
date Wed, 02 Sep 2009 11:40:51 +0000
parents d0e32062b497
children 529a4d41c67a
files gamelib/gameboard.py
diffstat 1 files changed, 1 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/gamelib/gameboard.py	Wed Sep 02 11:28:00 2009 +0000
+++ b/gamelib/gameboard.py	Wed Sep 02 11:40:51 2009 +0000
@@ -250,7 +250,7 @@
             self.disp.event(e)
 
     def clear_foxes(self):
-        for fox in self.foxes:
+        for fox in self.foxes[:]:
             # Any foxes that didn't make it to the woods are automatically
             # killed
             if self.in_bounds(fox.pos) and self.tv.get(fox.pos.to_tuple()) \