Commit 102c4d4d authored by Vincent Pelletier's avatar Vincent Pelletier

For original representation, use original __setstate__.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@43936 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 9263c0f9
......@@ -34,6 +34,8 @@ SyntaxError, DateError, TimeError, localtime, time
STATE_KEY = 'str'
original_DateTime__setstate__ = DateTimeKlass.__setstate__
def DateTime__setstate__(self, state):
self.__dict__.clear()
if isinstance(state, tuple):
......@@ -45,7 +47,7 @@ def DateTime__setstate__(self, state):
self._parse_args(yr, mo, dy, hr, mn, sc, tz, t, d, s)
elif len(state) != 1 or STATE_KEY not in state:
# For original pickle representation
self.__dict__.update(state)
original_DateTime__setstate__(self, state)
else:
# For r15569 implementation
self._parse_args(state[STATE_KEY])
......
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