1
0
mirror of https://github.com/gsi-upm/senpy synced 2025-09-18 20:42:22 +00:00

Fixed pickling error in py2.7

This commit is contained in:
J. Fernando Sánchez
2017-05-17 16:51:01 +02:00
parent ea91e3e4a4
commit 0f89b92457
2 changed files with 3 additions and 4 deletions

View File

@@ -98,7 +98,7 @@ class ShelfMixin(object):
if os.path.isfile(self.shelf_file):
try:
self.__dict__['_sh'] = pickle.load(open(self.shelf_file, 'rb'))
except (EOFError, pickle.UnpicklingError):
except (IndexError, EOFError, pickle.UnpicklingError):
logger.warning('{} has a corrupted shelf file!'.format(self.id))
if not self.get('force_shelf', False):
raise