summaryrefslogtreecommitdiffstats
path: root/Lib/shelve.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/shelve.py')
-rw-r--r--Lib/shelve.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/Lib/shelve.py b/Lib/shelve.py
index 4959c26..7a75445 100644
--- a/Lib/shelve.py
+++ b/Lib/shelve.py
@@ -139,6 +139,9 @@ class Shelf(UserDict.DictMixin):
self.dict = 0
def __del__(self):
+ if not hasattr(self, 'writeback'):
+ # __init__ didn't succeed, so don't bother closing
+ return
self.close()
def sync(self):