Commit ff82f7bb authored by Vincent Pelletier's avatar Vincent Pelletier

Old DateTime had no __setstate__, restore compatibility.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@43938 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 676a41a3
...@@ -34,7 +34,14 @@ SyntaxError, DateError, TimeError, localtime, time ...@@ -34,7 +34,14 @@ SyntaxError, DateError, TimeError, localtime, time
STATE_KEY = 'str' STATE_KEY = 'str'
original_DateTime__setstate__ = DateTimeKlass.__setstate__ try:
original_DateTime__setstate__ = DateTimeKlass.__setstate__
except AttributeError:
# BBB: Running on Zope < 2.11
def original_DateTime__setstate__(self, state):
dikt = self.__dict__
dikt.clear()
dikt.update(state)
def DateTime__setstate__(self, state): def DateTime__setstate__(self, state):
self.__dict__.clear() self.__dict__.clear()
......
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