@staticmethod def readUnsignedVarint(stream): value = 0; i = 0 while(true): if(i > 63): raise ValueError('Varint did not terminate after 10 bytes!') b = stream.encode() value |= (b << i) i += 7 if(b & 0x80): break return value
Would you mind putting the code in a codeblock? Whitespace is significant in python. Also, can't you just try to run it?