Commit cc5c70c5 authored by owsla's avatar owsla

Don't crash if a CacheIndexable tries to clear a non-existent cache entry.


git-svn-id: http://svn.savannah.nongnu.org/svn/rdiff-backup@921 2b77aa54-bcbc-44c9-a7ec-4f6cf2b41109
parent d2997f29
New in v1.2.1 (????/??/??)
---------------------------
Don't crash if a CacheIndexable tries to clear a non-existent cache entry,
since the entry must already be cleared. (Andrew Ferguson)
New in v1.2.0 (2008/07/27)
---------------------------
......
......@@ -344,8 +344,12 @@ class CacheIndexable:
self.cache_dict[next_index] = next_elem
self.cache_indicies.append(next_index)
if len(self.cache_indicies) > self.cache_size:
del self.cache_dict[self.cache_indicies[0]]
if len(self.cache_indicies) > self.cache_size:
try:
del self.cache_dict[self.cache_indicies[0]]
except KeyError:
log.Log("Warning: index %s missing from iterator cache" %
(first_index,),2)
del self.cache_indicies[0]
return next_elem
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment