Skip to content

Commit

Permalink
repozo: do not close file in concat function
Browse files Browse the repository at this point in the history
But let the caller opening the file closing it
  • Loading branch information
Sebatyne committed Nov 23, 2018
1 parent a835827 commit d6bcc5a
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 3 deletions.
2 changes: 0 additions & 2 deletions src/ZODB/scripts/repozo.py
Expand Up @@ -360,8 +360,6 @@ def func(data):
ifp = open(f, 'rb')
bytesread += dofile(func, ifp)
ifp.close()
if ofp:
ofp.close()
return bytesread, sum.hexdigest()


Expand Down
2 changes: 1 addition & 1 deletion src/ZODB/scripts/tests/test_repozo.py
Expand Up @@ -414,7 +414,7 @@ def close(self):
ofp = Faux()
bytes, sum = self._callFUT(files, ofp)
self.assertEqual(ofp._written, [x.encode() for x in 'ABC'])
self.assertTrue(ofp._closed)
self.assertFalse(ofp._closed)

_marker = object()
class Test_gen_filename(OptionsTestBase, unittest.TestCase):
Expand Down

0 comments on commit d6bcc5a

Please sign in to comment.