Commit 0a419b7b authored by Giampaolo Rodola's avatar Giampaolo Rodola

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)>
parent b8698f8e
......@@ -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 "",
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment