aboutsummaryrefslogtreecommitdiffstats
path: root/netlib
diff options
context:
space:
mode:
Diffstat (limited to 'netlib')
-rw-r--r--netlib/tcp.py6
1 files changed, 1 insertions, 5 deletions
diff --git a/netlib/tcp.py b/netlib/tcp.py
index 61b41cdc..6423888a 100644
--- a/netlib/tcp.py
+++ b/netlib/tcp.py
@@ -355,9 +355,6 @@ class Address(utils.Serializable):
def __repr__(self):
return "{}:{}".format(self.host, self.port)
- def __str__(self):
- return str(self.address)
-
def __eq__(self, other):
if not other:
return False
@@ -698,8 +695,7 @@ class TCPClient(_Connection):
if self.source_address:
connection.bind(self.source_address())
connection.connect(self.address())
- if not self.source_address:
- self.source_address = Address(connection.getsockname())
+ self.source_address = Address(connection.getsockname())
except (socket.error, IOError) as err:
raise TcpException(
'Error connecting to "%s": %s' %