From: Avery Pennarun Date: Thu, 4 Feb 2010 23:56:01 +0000 (-0500) Subject: On python 2.4 on MacOS X, __len__() must return an int. X-Git-Url: https://git.michaelhowe.org/gitweb/?a=commitdiff_plain;h=ea8b66b0f465a48109211adbae23798e7148cbf5;p=packages%2Fb%2Fbup.git On python 2.4 on MacOS X, __len__() must return an int. 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. --- diff --git a/git.py b/git.py index 2ac3cf6..23c0d46 100644 --- 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): diff --git a/index.py b/index.py index c07c7fe..a4fb420 100644 --- 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)