Catch UnpicklingError in Cache.read
This commit is contained in:
parent
c6a8bea31e
commit
c32ed0360f
|
@ -58,7 +58,7 @@ class Cache(MutableMapping):
|
||||||
with open(path, 'rb') as f:
|
with open(path, 'rb') as f:
|
||||||
try:
|
try:
|
||||||
data = pickle.load(f)
|
data = pickle.load(f)
|
||||||
except EOFError:
|
except EOFError or pickle.UnpicklingError:
|
||||||
logger.debug('Couldn\'t read cache')
|
logger.debug('Couldn\'t read cache')
|
||||||
return cls(path, data)
|
return cls(path, data)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue