Skip to content

Commit fe5ee43

Browse files
committed
Close the cache explicitly before deleting the reference
1 parent 0f5d8ed commit fe5ee43

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

diskcache/persistent.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -533,12 +533,13 @@ def reverse(self):
533533
# GrantJ 2019-03-22 Consider using an algorithm that swaps the values
534534
# at two keys. Like self._cache.swap(key1, key2, retry=True) The swap
535535
# method would exchange the values at two given keys. Then, using a
536-
# forward iterator and a reverse iterator, the reversis method could
536+
# forward iterator and a reverse iterator, the reverse method could
537537
# avoid making copies of the values.
538538
temp = Deque(iterable=reversed(self))
539539
self.clear()
540540
self.extend(temp)
541541
directory = temp.directory
542+
temp.close()
542543
del temp
543544
rmtree(directory)
544545

0 commit comments

Comments
 (0)