Skip to content

Commit

Permalink
cache_shelve: wrap deletions in try..except in purge_outdated
Browse files Browse the repository at this point in the history
Hopefully solves #402 and #439.
  • Loading branch information
Virgil Dupras committed Sep 19, 2017
1 parent a6b1e6e commit 2f31dc7
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions core/pe/cache_shelve.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,11 @@ def purge_outdated(self):
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

0 comments on commit 2f31dc7

Please sign in to comment.