Fix pickling (again). Unit tests still pass.

This commit is contained in:
Luca Beltrame
2011-07-14 09:36:35 +02:00
parent cd5aa4fc06
commit 2c5a9af76e
+8 -1
View File
@@ -57,7 +57,14 @@ class Row(object):
del self._row[i]
def __getstate__(self):
return {'slot': [getattr(self, slot) for slot in self.__slots__]}
slots = dict()
for slot in self.__slots__:
attribute = getattr(self, slot)
slots[slot] = attribute
return slots
def __setstate__(self, state):
for (k, v) in list(state.items()): setattr(self, k, v)