Fix reload to use a copy of datafile keys
authorJeremy Stanley <fungi@yuggoth.org>
Mon, 10 Feb 2014 01:57:26 +0000 (01:57 +0000)
committerJeremy Stanley <fungi@yuggoth.org>
Mon, 10 Feb 2014 01:57:26 +0000 (01:57 +0000)
* lib/mudpy/misc.py: Python 2.x was more tolerant of this and it now
breaks under 3.4 release candidates, but correcting it to iterate over a
copy is arguably more correct anyway.

lib/mudpy/misc.py

index a463653..d78eac6 100644 (file)
@@ -85,7 +85,7 @@ class Element:
 
     def reload(self):
         """Create a new element and replace this one."""
-        new_element = Element(self.key, self.universe, self.origin.filename)
+        Element(self.key, self.universe, self.origin.filename)
         del(self)
 
     def destroy(self):
@@ -462,7 +462,7 @@ class Universe:
 
             # clear out all read-only files
             if hasattr(self, "files"):
-                for data_filename in self.files.keys():
+                for data_filename in list(self.files.keys()):
                     if not self.files[data_filename].is_writeable():
                         del self.files[data_filename]