From c32ed0360f7c8d4239998d62690b5655427d95bf Mon Sep 17 00:00:00 2001 From: Thor77 Date: Mon, 5 Feb 2018 15:49:49 +0100 Subject: [PATCH] Catch UnpicklingError in Cache.read --- tsstats/cache.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tsstats/cache.py b/tsstats/cache.py index 3cca470..08dfb11 100644 --- a/tsstats/cache.py +++ b/tsstats/cache.py @@ -58,7 +58,7 @@ class Cache(MutableMapping): with open(path, 'rb') as f: try: data = pickle.load(f) - except EOFError: + except EOFError or pickle.UnpicklingError: logger.debug('Couldn\'t read cache') return cls(path, data)