* morituri/common/common.py:
Don't fail on loading pickle.
This commit is contained in:
@@ -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:
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user