Commit f76b777b authored by Ian Wood's avatar Ian Wood
Browse files

don't fail if shelf pickle file broken

parent 13cefbed
......@@ -96,7 +96,10 @@ class ShelfMixin(object):
if not hasattr(self, '_sh') or self._sh is None:
self.__dict__['_sh'] = {}
if os.path.isfile(self.shelf_file):
try:
self.__dict__['_sh'] = pickle.load(open(self.shelf_file, 'rb'))
except EOFError:
logger.warning('corrupted shelf file!')
return self._sh
@sh.deleter
......
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