Commit d6bcc5a4 authored by Nicolas Wavrant's avatar Nicolas Wavrant

repozo: do not close file in concat function

But let the caller opening the file closing it
parent a8358277
...@@ -360,8 +360,6 @@ def concat(files, ofp=None): ...@@ -360,8 +360,6 @@ def concat(files, ofp=None):
ifp = open(f, 'rb') ifp = open(f, 'rb')
bytesread += dofile(func, ifp) bytesread += dofile(func, ifp)
ifp.close() ifp.close()
if ofp:
ofp.close()
return bytesread, sum.hexdigest() return bytesread, sum.hexdigest()
......
...@@ -414,7 +414,7 @@ class Test_concat(OptionsTestBase, unittest.TestCase): ...@@ -414,7 +414,7 @@ class Test_concat(OptionsTestBase, unittest.TestCase):
ofp = Faux() ofp = Faux()
bytes, sum = self._callFUT(files, ofp) bytes, sum = self._callFUT(files, ofp)
self.assertEqual(ofp._written, [x.encode() for x in 'ABC']) self.assertEqual(ofp._written, [x.encode() for x in 'ABC'])
self.assertTrue(ofp._closed) self.assertFalse(ofp._closed)
_marker = object() _marker = object()
class Test_gen_filename(OptionsTestBase, unittest.TestCase): class Test_gen_filename(OptionsTestBase, unittest.TestCase):
......
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