* morituri/common/common.py:

Don't fail on loading pickle.
This commit is contained in:
Thomas Vander Stichele
2011-05-19 10:03:30 +00:00
parent 0b520f2e86
commit 019ad538d8
2 changed files with 12 additions and 1 deletions

View File

@@ -1,3 +1,8 @@
2011-05-19 Thomas Vander Stichele <thomas at apestaart dot org>
* morituri/common/common.py:
Don't fail on loading pickle.
2011-05-19 Thomas Vander Stichele <thomas at apestaart dot org>
* morituri/common/encode.py:

View File

@@ -144,7 +144,13 @@ class Persister(object):
handle = open(self._path)
import pickle
self.object = pickle.load(handle)
try:
self.object = pickle.load(handle)
except:
# can fail for various reasons; in that case, pretend we didn't
# load it
pass
def delete(self):
self.object = None