diff gamelib/gameboard.py @ 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 fa8d8fc1bf5b
children 725b292ca07b
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()) \