Handle all exceptions loading pickled data

The pickle file is just a local cache of Gerrit data. If we fail to
load it, it will just be regenerated from Gerrit. We should never
allow a failure in pickle.load to be fatal.

Change-Id: If433fa5f335db8db63cdd264919c0dbeb3a7a32e
This commit is contained in:
Ben Nemec 2019-04-16 15:50:06 +00:00
parent 59d12c214e
commit 1bbf631545
1 changed files with 3 additions and 1 deletions

View File

@ -147,7 +147,9 @@ def get_changes(projects, ssh_user, ssh_key, only_open=False, stable='',
with open(pickle_fn, 'r') as f:
try:
changes = pickle.load(f)
except MemoryError:
except Exception:
logging.warning('Failed to load cached data from %s',
pickle_fn)
changes = {}
if not isinstance(changes, dict):