From 46fadfc82386265c26b77ea0d8c3801585c84fbc Mon Sep 17 00:00:00 2001 From: Maximilian Hils Date: Mon, 18 May 2015 17:16:42 +0200 Subject: [PATCH] improve displaying tcp addresses --- netlib/tcp.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/netlib/tcp.py b/netlib/tcp.py index dbe114a1c..a5f43ea35 100644 --- a/netlib/tcp.py +++ b/netlib/tcp.py @@ -245,7 +245,10 @@ class Address(object): self.family = socket.AF_INET6 if b else socket.AF_INET def __repr__(self): - return repr(self.address) + return "{}:{}".format(self.host, self.port) + + def __str__(self): + return str(self.address) def __eq__(self, other): other = Address.wrap(other)