diff options
author | Victor Stinner <victor.stinner@gmail.com> | 2014-10-12 07:52:11 (GMT) |
---|---|---|
committer | Victor Stinner <victor.stinner@gmail.com> | 2014-10-12 07:52:11 (GMT) |
commit | 0e34dc37379e3c42b19c30410e190966e65f4dad (patch) | |
tree | 230db20a3170b0e97c101a074ce5d24754f5d2a3 /Lib/asyncio/proactor_events.py | |
parent | fa62f4ceddb889d7645c739b049210262e8d39f1 (diff) | |
download | cpython-0e34dc37379e3c42b19c30410e190966e65f4dad.zip cpython-0e34dc37379e3c42b19c30410e190966e65f4dad.tar.gz cpython-0e34dc37379e3c42b19c30410e190966e65f4dad.tar.bz2 |
asyncio: enhance protocol representation
Add "closed" or "closing" to repr() of selector and proactor transports
Diffstat (limited to 'Lib/asyncio/proactor_events.py')
-rw-r--r-- | Lib/asyncio/proactor_events.py | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/Lib/asyncio/proactor_events.py b/Lib/asyncio/proactor_events.py index 0ad0656..7132300 100644 --- a/Lib/asyncio/proactor_events.py +++ b/Lib/asyncio/proactor_events.py @@ -42,7 +42,13 @@ class _ProactorBasePipeTransport(transports._FlowControlMixin, self._loop.call_soon(waiter._set_result_unless_cancelled, None) def __repr__(self): - info = [self.__class__.__name__, 'fd=%s' % self._sock.fileno()] + info = [self.__class__.__name__] + fd = self._sock.fileno() + if fd < 0: + info.append('closed') + elif self._closing: + info.append('closing') + info.append('fd=%s' % fd) if self._read_fut is not None: info.append('read=%s' % self._read_fut) if self._write_fut is not None: |