Commit ea82bc70 authored by Barry Warsaw's avatar Barry Warsaw

__init__(), close(): Add a _closed flag so we don't try to enter

_doclose() twice (runsvr.py had a bug that caused the storages to be
closed twice).
parent da1bff71
......@@ -14,7 +14,7 @@
"""Base class for BerkeleyStorage implementations.
"""
__version__ = '$Revision: 1.27 $'.split()[-2:][0]
__version__ = '$Revision: 1.28 $'.split()[-2:][0]
import os
import time
......@@ -190,7 +190,7 @@ class BerkeleyBase(BaseStorage):
# Instantiate a pack lock
self._packlock = ThreadLock.allocate_lock()
self._autopacker = None
self._stop = False
self._stop = self._closed = False
# Initialize a few other things
self._prefix = prefix
# Give the subclasses a chance to interpose into the database setup
......@@ -316,7 +316,9 @@ class BerkeleyBase(BaseStorage):
self._stop = True
self._lock_acquire()
try:
self._doclose()
if not self._closed:
self._doclose()
self._closed = True
finally:
self._lock_release()
......
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