# HG changeset patch # User Neil Muller # Date 1251891651 0 # Node ID a851461d345e2fa5bbdc6782ebda7247db1bace4 # Parent d0e32062b4974fcbb5d282cf4967eff02a455ce6 Iterate over a copy of the loop when changing it diff -r d0e32062b497 -r a851461d345e gamelib/gameboard.py --- 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()) \