Commit 44db3a6f authored by Iustin Pop's avatar Iustin Pop
Browse files

Fix a python 2.6.5 compatibility



The upcoming python 2.6.5 release has a change that makes delattr(obj,
attr) fail for slots-enabled objects if the attr is not already set.

To prevent against this, we only run the delattr if the attribute is
already set.
Signed-off-by: default avatarIustin Pop <iustin@google.com>
Reviewed-by: default avatarGuido Trotter <ultrotter@google.com>
parent c6a39fc2
......@@ -90,7 +90,7 @@ class BaseOpCode(object):
type(state))
for name in self._all_slots():
if name not in state:
if name not in state and hasattr(self, name):
delattr(self, name)
for name in state:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment