From ec628bc37d173b622e905e8012a08a7328cf7215 Mon Sep 17 00:00:00 2001 From: Maximilian Hils Date: Thu, 4 Sep 2014 01:10:44 +0200 Subject: fix tcp.Address inequality comparison --- netlib/tcp.py | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'netlib') 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): -- cgit v1.2.3