From: Brandon Low Date: Sun, 2 Jan 2011 08:49:22 +0000 (-0800) Subject: Use chunkyreader() instead of manually reading multiple blocks. X-Git-Url: https://git.michaelhowe.org/gitweb/?a=commitdiff_plain;h=9d35f6a3ae0d0f5a02651b42b32c3b9a2cbf7e2a;p=packages%2Fb%2Fbup.git Use chunkyreader() instead of manually reading multiple blocks. Signed-off-by: Brandon Low --- diff --git a/lib/bup/git.py b/lib/bup/git.py index 6a65c43..4ca31d7 100644 --- a/lib/bup/git.py +++ b/lib/bup/git.py @@ -651,12 +651,9 @@ class PackWriter: # calculate the pack sha1sum f.seek(0) sum = Sha1() - while 1: - b = f.read(65536) + for b in chunkyreader(f): sum.update(b) - if not b: break f.write(sum.digest()) - f.close() p = subprocess.Popen(['git', 'index-pack', '-v',