mirror of
https://github.com/python/cpython.git
synced 2025-10-09 16:34:44 +00:00
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
1 changed files with 1 additions and 1 deletions
|
@ -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…
Add table
Add a link
Reference in a new issue