Skip to content

Commit

Permalink
! findspam.py: purge_cache(): avoid KeyError
Browse files Browse the repository at this point in the history
  • Loading branch information
tripleee committed Nov 23, 2018
1 parent 3380c7a commit ff5b03f
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion findspam.py
Expand Up @@ -554,7 +554,9 @@ def purge_cache(cachevar, limit):
log('debug', 'purge_cache({0}): oldest remaining entry is {1}'.format(
limit, now - cachevar[remaining]['timestamp']))
for old in oldest:
del cachevar[old]
# Guard against KeyError; race condition?
if old in cachevar:
del cachevar[old]


def dns_query(label, qtype):
Expand Down

0 comments on commit ff5b03f

Please sign in to comment.