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)>
This commit is contained in:
parent
5179445520
commit
b62814998a
|
@ -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 "",
|
||||
|
|
Loading…
Reference in New Issue