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