Commit 4e24dc55 authored by Georg Brandl's avatar Georg Brandl

Bug #1339007: Shelf objects now don't raise an exception in their

__del__ method when initialization failed.
parent 1d369fe7
...@@ -139,6 +139,9 @@ class Shelf(UserDict.DictMixin): ...@@ -139,6 +139,9 @@ class Shelf(UserDict.DictMixin):
self.dict = 0 self.dict = 0
def __del__(self): def __del__(self):
if not hasattr(self, 'writeback'):
# __init__ didn't succeed, so don't bother closing
return
self.close() self.close()
def sync(self): def sync(self):
......
...@@ -156,6 +156,9 @@ Extension Modules ...@@ -156,6 +156,9 @@ Extension Modules
Library Library
------- -------
- Bug #1339007: Shelf objects now don't raise an exception in their
__del__ method when initialization failed.
- Patch #1455898: The MBCS codec now supports the incremental mode for - Patch #1455898: The MBCS codec now supports the incremental mode for
double-byte encodings. double-byte encodings.
......
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