]> arthur.barton.de Git - bup.git/commitdiff
On python 2.4 on MacOS X, __len__() must return an int.
authorAvery Pennarun <apenwarr@gmail.com>
Thu, 4 Feb 2010 23:56:01 +0000 (18:56 -0500)
committerAvery Pennarun <apenwarr@gmail.com>
Thu, 4 Feb 2010 23:56:01 +0000 (18:56 -0500)
We were already returning integers, which seem to be "long ints" in this
case, even though they're relatively small.  Whatever, we'll typecast them
to int first, and now unit tests pass.

git.py
index.py

diff --git a/git.py b/git.py
index 2ac3cf6d4b7e9f86176f92ab457a715c11a41c9b..23c0d46fd6679b8f2227a00e80855048ea5801f7 100644 (file)
--- a/git.py
+++ b/git.py
@@ -136,7 +136,7 @@ class PackIndex:
             yield buffer(self.map, 8 + 256*4 + 20*i, 20)
 
     def __len__(self):
-        return self.fanout[255]
+        return int(self.fanout[255])
 
 
 def extract_bits(buf, bits):
index c07c7fece9495f9809f775515eaf32f34160689d..a4fb4200a129e2a0c30a3f43139a096207abf6ae 100644 (file)
--- a/index.py
+++ b/index.py
@@ -206,7 +206,7 @@ class Reader:
         self.close()
 
     def __len__(self):
-        return self.count
+        return int(self.count)
 
     def forward_iter(self):
         ofs = len(INDEX_HDR)