[entropy.db] direct: wrap yield around a try/finally block

This commit is contained in:
Fabio Erculiani
2013-12-07 12:33:20 +01:00
parent c356d615f3
commit b26842e826
+4 -3
View File
@@ -454,9 +454,10 @@ class EntropyRepositoryBase(TextInterface, EntropyRepositoryPluginStore):
counter = getattr(self._tls, "_EntropyRepositoryCacheCounter", 0)
self._tls._EntropyRepositoryCacheCounter = counter + 1
yield
self._tls._EntropyRepositoryCacheCounter -= 1
try:
yield
finally:
self._tls._EntropyRepositoryCacheCounter -= 1
def directed(self):
"""