summaryrefslogtreecommitdiffstats
path: root/Lib/socket.py
diff options
context:
space:
mode:
authorGiampaolo Rodola' <g.rodola@gmail.com>2013-10-03 19:01:43 (GMT)
committerGiampaolo Rodola' <g.rodola@gmail.com>2013-10-03 19:01:43 (GMT)
commitb62814998ab0a1dd16830eaaa4e6e6d8618872e1 (patch)
tree081825b8fefd789ea708dba3ef4943daa718ae64 /Lib/socket.py
parent51794455208e182f5f2e3ca1174b1361c46f8e04 (diff)
downloadcpython-b62814998ab0a1dd16830eaaa4e6e6d8618872e1.zip
cpython-b62814998ab0a1dd16830eaaa4e6e6d8618872e1.tar.gz
cpython-b62814998ab0a1dd16830eaaa4e6e6d8618872e1.tar.bz2
Provide a more readable representation of socket on repr().
Before: <socket.socket fd=3, family=2, type=1, proto=0, laddr=('0.0.0.0', 0)> Now: <socket.socket fd=3, family=AddressFamily.AF_INET, type=SocketType.SOCK_STREAM, proto=0, laddr=('0.0.0.0', 0)>
Diffstat (limited to 'Lib/socket.py')
-rw-r--r--Lib/socket.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/Lib/socket.py b/Lib/socket.py
index 576ac55..6d67b3d 100644
--- a/Lib/socket.py
+++ b/Lib/socket.py
@@ -136,7 +136,7 @@ class socket(_socket.socket):
address(es).
"""
closed = getattr(self, '_closed', False)
- s = "<%s.%s%s fd=%i, family=%i, type=%i, proto=%i" \
+ s = "<%s.%s%s fd=%i, family=%s, type=%s, proto=%i" \
% (self.__class__.__module__,
self.__class__.__name__,
" [closed]" if closed else "",