From: Avery Pennarun Date: Sun, 24 Jan 2010 22:46:51 +0000 (-0500) Subject: In some versions of python, comparing buffers with < gives a warning. X-Git-Url: https://git.michaelhowe.org/gitweb/?a=commitdiff_plain;h=94d746cb491f3cb4469cddfc8dafa1b6170c7621;p=packages%2Fb%2Fbup.git In some versions of python, comparing buffers with < gives a warning. It seems to be a buggy warning. But we only really do it in one place, and buffers in question are only 20 bytes long, so forcing them into strings seems harmless enough. --- diff --git a/git.py b/git.py index 684bd5e..a94f53c 100644 --- a/git.py +++ b/git.py @@ -151,10 +151,10 @@ class PackIndex: start = self.fanout[b1-1] # range -1..254 end = self.fanout[b1] # range 0..255 buf = buffer(self.map, 8 + 256*4, end*20) - want = buffer(hash) + want = str(hash) while start < end: mid = start + (end-start)/2 - v = buffer(buf, mid*20, 20) + v = str(buf[mid*20:(mid+1)*20]) if v < want: start = mid+1 elif v > want: