aboutsummaryrefslogtreecommitdiffstats
path: root/netlib/tcp.py
diff options
context:
space:
mode:
authorMaximilian Hils <git@maximilianhils.com>2014-09-04 01:10:44 +0200
committerMaximilian Hils <git@maximilianhils.com>2014-09-04 01:10:44 +0200
commitec628bc37d173b622e905e8012a08a7328cf7215 (patch)
tree609ee98729ffcff5ef6ff6f90af6d8064d4b85ac /netlib/tcp.py
parent3d489f3bb7db6dda7b8476f6daa2177048c911ff (diff)
downloadmitmproxy-ec628bc37d173b622e905e8012a08a7328cf7215.tar.gz
mitmproxy-ec628bc37d173b622e905e8012a08a7328cf7215.tar.bz2
mitmproxy-ec628bc37d173b622e905e8012a08a7328cf7215.zip
fix tcp.Address inequality comparison
Diffstat (limited to 'netlib/tcp.py')
-rw-r--r--netlib/tcp.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/netlib/tcp.py b/netlib/tcp.py
index b386603c..5ecfca9d 100644
--- a/netlib/tcp.py
+++ b/netlib/tcp.py
@@ -216,10 +216,16 @@ class Address(object):
def use_ipv6(self, b):
self.family = socket.AF_INET6 if b else socket.AF_INET
+ def __repr__(self):
+ return repr(self.address)
+
def __eq__(self, other):
other = Address.wrap(other)
return (self.address, self.family) == (other.address, other.family)
+ def __ne__(self, other):
+ return not self.__eq__(other)
+
class _Connection(object):
def get_current_cipher(self):