diff options
author | Victor Stinner <victor.stinner@gmail.com> | 2015-01-15 13:32:10 +0100 |
---|---|---|
committer | Victor Stinner <victor.stinner@gmail.com> | 2015-01-15 13:32:10 +0100 |
commit | 427c97554a15694a2c63509b681a6d0e6a56853e (patch) | |
tree | 6913d42d55dd1b75867fa446e7bc34cd360c511d /asyncio | |
parent | f20d9b867e1bf0da4d9b453c6eb3d5c5135069ab (diff) | |
download | trollius-427c97554a15694a2c63509b681a6d0e6a56853e.tar.gz |
Fix _ProactorBasePipeTransport.__repr__()
Check if the _sock attribute is None to check if the transport is closed.
Diffstat (limited to 'asyncio')
-rw-r--r-- | asyncio/proactor_events.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/asyncio/proactor_events.py b/asyncio/proactor_events.py index 0ecb44e..a177d32 100644 --- a/asyncio/proactor_events.py +++ b/asyncio/proactor_events.py @@ -43,12 +43,12 @@ class _ProactorBasePipeTransport(transports._FlowControlMixin, def __repr__(self): info = [self.__class__.__name__] - fd = self._sock.fileno() - if fd < 0: + if self._sock is None: info.append('closed') elif self._closing: info.append('closing') - info.append('fd=%s' % fd) + if self._sock is not None: + info.append('fd=%s' % self._sock.fileno()) if self._read_fut is not None: info.append('read=%s' % self._read_fut) if self._write_fut is not None: |