From: W. Trevor King Date: Wed, 12 May 2010 15:03:46 +0000 (-0400) Subject: Fix problem in Queuing odict/HookeConfigParser. X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=9f05b0e1e2855a78a560473f3414d69ac898005b;p=hooke.git Fix problem in Queuing odict/HookeConfigParser. I'm not sure why odict.__setstate__() is not being called before .__setitem__(), but this hack seems to be a valid workaround. --- diff --git a/hooke/compat/odict.py b/hooke/compat/odict.py index 22de85c..d204c6d 100644 --- a/hooke/compat/odict.py +++ b/hooke/compat/odict.py @@ -208,6 +208,8 @@ class odict(dict): self._keys.remove(key) def __setitem__(self, key, item): + if not hasattr(self, '_keys'): + self._keys = [] # work around multiprocessing.Queue rebuild if key not in self: self._keys.append(key) dict.__setitem__(self, key, item)