1
0
Fork 0
mirror of https://github.com/Thor77/TeamspeakStats.git synced 2025-07-07 07:58:43 -04:00

Catch UnpicklingError in Cache.read

This commit is contained in:
Thor77 2018-02-05 15:49:49 +01:00
parent c6a8bea31e
commit c32ed0360f

View file

@ -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)