Skip to content

Commit

Permalink
Fix exit error TypeError("NoneType object is not callable",) using ca…
Browse files Browse the repository at this point in the history
…tch try block in close method #45
  • Loading branch information
tmylk committed May 15, 2016
1 parent 726d2ca commit 9cc6dd3
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion sqlitedict.py
Original file line number Diff line number Diff line change
Expand Up @@ -315,7 +315,13 @@ def terminate(self):

def __del__(self):
# like close(), but assume globals are gone by now (do not log!)
self.close(do_log=False)
try:
self.close(do_log=False)
except Exception:
# prevent error log flood in case of multiple SqliteDicts
# closed after connection lost (exceptions are always ignored
# in __del__ method.
pass

# Adding extra methods for python 2 compatibility (at import time)
if major_version == 2:
Expand Down

0 comments on commit 9cc6dd3

Please sign in to comment.