aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/Lib/asyncio/selector_events.py
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@gmail.com>2014-10-12 09:52:11 +0200
committerVictor Stinner <victor.stinner@gmail.com>2014-10-12 09:52:11 +0200
commit0e34dc37379e3c42b19c30410e190966e65f4dad (patch)
tree230db20a3170b0e97c101a074ce5d24754f5d2a3 /Lib/asyncio/selector_events.py
parentfa62f4ceddb889d7645c739b049210262e8d39f1 (diff)
downloadcpython-0e34dc37379e3c42b19c30410e190966e65f4dad.tar.gz
cpython-0e34dc37379e3c42b19c30410e190966e65f4dad.zip
asyncio: enhance protocol representation
Add "closed" or "closing" to repr() of selector and proactor transports
Diffstat (limited to 'Lib/asyncio/selector_events.py')
-rw-r--r--Lib/asyncio/selector_events.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/Lib/asyncio/selector_events.py b/Lib/asyncio/selector_events.py
index 33de92e1e4b..a55eff78767 100644
--- a/Lib/asyncio/selector_events.py
+++ b/Lib/asyncio/selector_events.py
@@ -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,