cache_shelve: wrap deletions in try..except in purge_outdated

Hopefully solves #402 and #439.
This commit is contained in:
Virgil Dupras 2017-09-19 13:22:33 -04:00
parent a6b1e6e9ab
commit 2f31dc7aab
1 changed files with 7 additions and 2 deletions

View File

@ -126,6 +126,11 @@ class ShelveCache:
continue
todelete.append(path)
for path in todelete:
del self[path]
try:
del self[path]
except KeyError:
# I have no idea why a KeyError sometimes happen, but it does, as we can see in
# #402 and #439. I don't think it hurts to silently ignore the error, so that's
# what we do
pass