Commit a6c36f62 authored by Jeremy Hylton's avatar Jeremy Hylton

Explicitly close the FileIterator.

parent 79a3d6c0
...@@ -38,7 +38,8 @@ def get_pickle_metadata(data): ...@@ -38,7 +38,8 @@ def get_pickle_metadata(data):
def fsdump(path, file=None, with_offset=1): def fsdump(path, file=None, with_offset=1):
i = 0 i = 0
for trans in FileIterator(path): iter = FileIterator(path)
for trans in iter:
if with_offset: if with_offset:
print >> file, "Trans #%05d tid=%016x time=%s offset=%d" % \ print >> file, "Trans #%05d tid=%016x time=%s offset=%d" % \
(i, U64(trans.tid), str(TimeStamp(trans.tid)), trans._pos) (i, U64(trans.tid), str(TimeStamp(trans.tid)), trans._pos)
...@@ -68,4 +69,4 @@ def fsdump(path, file=None, with_offset=1): ...@@ -68,4 +69,4 @@ def fsdump(path, file=None, with_offset=1):
j += 1 j += 1
print >> file print >> file
i += 1 i += 1
iter.close()
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