From: Jeremy Stanley Date: Mon, 10 Feb 2014 01:57:26 +0000 (+0000) Subject: Fix reload to use a copy of datafile keys X-Git-Tag: 0.0.1~255 X-Git-Url: https://mudpy.org/gitweb?a=commitdiff_plain;h=015ea384dafbc17070d3c11e84004ca27b866eb9;p=mudpy.git Fix reload to use a copy of datafile keys * 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. --- diff --git a/lib/mudpy/misc.py b/lib/mudpy/misc.py index a463653..d78eac6 100644 --- a/lib/mudpy/misc.py +++ b/lib/mudpy/misc.py @@ -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]