don't fail if shelf pickle file broken

pull/35/head
Ian Wood 7 years ago
parent 13cefbedfb
commit f76b777b9f

@ -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):
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
@sh.deleter

Loading…
Cancel
Save