From ea8b66b0f465a48109211adbae23798e7148cbf5 Mon Sep 17 00:00:00 2001 From: Avery Pennarun Date: Thu, 4 Feb 2010 18:56:01 -0500 Subject: [PATCH] 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. --- git.py | 2 +- index.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) 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) -- 2.39.5