mirror of
https://github.com/gsi-upm/senpy
synced 2024-11-22 00:02:28 +00:00
don't fail if shelf pickle file broken
This commit is contained in:
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):
|
||||
try:
|
||||
self.__dict__['_sh'] = pickle.load(open(self.shelf_file, 'rb'))
|
||||
except EOFError:
|
||||
logger.warning('corrupted shelf file!')
|
||||
return self._sh
|
||||
|
||||
@sh.deleter
|
||||
|
Loading…
Reference in New Issue
Block a user