mirror of
https://github.com/zhigang1992/mitmproxy.git
synced 2026-04-29 04:35:02 +08:00
Py3: Use rich comparison methods (__eq__, __lt__) instead of __cmp__
This commit is contained in:
@@ -31,8 +31,11 @@ class _Action(base.Token):
|
||||
c.offset = l + 1
|
||||
return c
|
||||
|
||||
def __cmp__(self, other):
|
||||
return cmp(self.offset, other.offset)
|
||||
def __lt__(self, other):
|
||||
return self.offset < other.offset
|
||||
|
||||
def __eq__(self, other):
|
||||
return self.offset == other.offset
|
||||
|
||||
def __repr__(self):
|
||||
return self.spec()
|
||||
|
||||
Reference in New Issue
Block a user