]> arthur.barton.de Git - bup.git/commitdiff
Fix a couple of python 2.4 incompatibilities.
authorAvery Pennarun <apenwarr@gmail.com>
Tue, 8 Feb 2011 12:59:54 +0000 (04:59 -0800)
committerAvery Pennarun <apenwarr@gmail.com>
Tue, 8 Feb 2011 12:59:54 +0000 (04:59 -0800)
Thanks to Jimmy Tang for his help testing these since I don't have python
2.4 easily available.

Signed-off-by: Avery Pennarun <apenwarr@gmail.com>
cmd/midx-cmd.py
lib/bup/git.py

index 76b546637cff8553e0a8e762d528b9828f97ed02..efd3f7f86ae1f54e57197cbd7b8f4a820703f34b 100755 (executable)
@@ -6,6 +6,7 @@ from bup.helpers import *
 
 PAGE_SIZE=4096
 SHA_PER_PAGE=PAGE_SIZE/20.
+SEEK_END=2  # os.SEEK_END is not defined in python 2.4
 
 optspec = """
 bup midx [options...] <idxnames...>
@@ -86,7 +87,7 @@ def _do_midx(outdir, outfilename, infilenames, prefixstr):
     fmap.flush()
     fmap.close()
 
-    f.seek(0, os.SEEK_END)
+    f.seek(0, SEEK_END)
     f.write('\0'.join(allfilenames))
     f.close()
     os.rename(outfilename + '.tmp', outfilename)
index 32c7198d21050fdf7ac5d2eab03521e2a68567c8..153971143e65b8970fdc450a90b4627001b81947 100644 (file)
@@ -477,7 +477,7 @@ class ShaBloom:
         return cls(name, f=f, readwrite=True, expected=expected)
 
     def __len__(self):
-        return self.entries
+        return int(self.entries)
 
 
 class PackMidx: