mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
asyncio: enhance protocol representation
Add "closed" or "closing" to repr() of selector and proactor transports
This commit is contained in:
parent
fa62f4cedd
commit
0e34dc3737
2 changed files with 13 additions and 2 deletions
|
@ -467,7 +467,12 @@ class _SelectorTransport(transports._FlowControlMixin,
|
|||
self._server._attach()
|
||||
|
||||
def __repr__(self):
|
||||
info = [self.__class__.__name__, 'fd=%s' % self._sock_fd]
|
||||
info = [self.__class__.__name__]
|
||||
if self._sock is None:
|
||||
info.append('closed')
|
||||
elif self._closing:
|
||||
info.append('closing')
|
||||
info.append('fd=%s' % self._sock_fd)
|
||||
# test if the transport was closed
|
||||
if self._loop is not None:
|
||||
polling = _test_selector_event(self._loop._selector,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue