Skip to content

Commit

Permalink
Fix pickling (again). Unit tests still pass.
Browse files Browse the repository at this point in the history
  • Loading branch information
lbeltrame committed Jul 14, 2011
1 parent cd5aa4f commit 2c5a9af
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion tablib/core.py
Expand Up @@ -57,7 +57,14 @@ def __delitem__(self, i):
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)
Expand Down

0 comments on commit 2c5a9af

Please sign in to comment.