asyncio: Fix _ProactorBasePipeTransport.__repr__()
Check if the _sock attribute is None to check if the transport is closed.
This commit is contained in:
parent
02392c9282
commit
79c93ba47b
@ -43,12 +43,12 @@ class _ProactorBasePipeTransport(transports._FlowControlMixin,
|
|||||||
|
|
||||||
def __repr__(self):
|
def __repr__(self):
|
||||||
info = [self.__class__.__name__]
|
info = [self.__class__.__name__]
|
||||||
fd = self._sock.fileno()
|
if self._sock is None:
|
||||||
if fd < 0:
|
|
||||||
info.append('closed')
|
info.append('closed')
|
||||||
elif self._closing:
|
elif self._closing:
|
||||||
info.append('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:
|
if self._read_fut is not None:
|
||||||
info.append('read=%s' % self._read_fut)
|
info.append('read=%s' % self._read_fut)
|
||||||
if self._write_fut is not None:
|
if self._write_fut is not None:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user