bpo-39672: shelve sigsegv crash (#18655)

Fixed shelve module crash when cleaning interpreter resources.
This commit is contained in:
Andrey Doroschenko 2020-06-29 15:49:21 +03:00
parent 25d40f78e3
commit a92ea548a1
1 changed files with 0 additions and 7 deletions

View File

@ -154,13 +154,6 @@ class Shelf(collections.abc.MutableMapping):
except:
self.dict = None
def __del__(self):
if not hasattr(self, 'writeback'):
# __init__ didn't succeed, so don't bother closing
# see http://bugs.python.org/issue1339007 for details
return
self.close()
def sync(self):
if self.writeback and self.cache:
self.writeback = False