Update shelve.py

This commit is contained in:
Andrey Doroschenko 2020-06-29 10:35:04 +03:00 committed by GitHub
parent 7e6728f780
commit 25d40f78e3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 2 deletions

View File

@ -165,8 +165,7 @@ class Shelf(collections.abc.MutableMapping):
if self.writeback and self.cache:
self.writeback = False
for key, entry in self.cache.items():
if key not in self:
self[key] = entry
self[key] = entry
self.writeback = True
self.cache = {}
if hasattr(self.dict, 'sync'):