diff --git a/bitfield/types.py b/bitfield/types.py index 762a0ad..f61d7a3 100644 --- a/bitfield/types.py +++ b/bitfield/types.py @@ -123,7 +123,7 @@ def __eq__(self, other): return self._value == other._value def __cmp__(self, other): - return self._value.__cmp__(int(other)) + return cmp(self._value, other) def __repr__(self): return '<%s: %s>' % (self.__class__.__name__, ', '.join('%s=%s' % (k, self.get_bit(n).is_set) for n, k in enumerate(self._keys)),)