Skip to content

Commit

Permalink
Fix ResourceWarnings caused by HexStorage.iterator()
Browse files Browse the repository at this point in the history
  • Loading branch information
mgedmin committed Mar 1, 2013
1 parent 4bdf054 commit b07519b
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/ZODB/tests/hexstorage.py
Expand Up @@ -82,8 +82,12 @@ def restore(self, oid, serial, data, version, prev_txn, transaction):
transaction)

def iterator(self, start=None, stop=None):
for t in self.base.iterator(start, stop):
yield Transaction(self, t)
it = self.base.iterator(start, stop)
try:
for t in it:
yield Transaction(self, t)
finally:
it.close()

def storeBlob(self, oid, oldserial, data, blobfilename, version,
transaction):
Expand Down

0 comments on commit b07519b

Please sign in to comment.