mirror of
https://github.com/python/cpython.git
synced 2025-10-09 16:34:44 +00:00
bpo-31647: Fix write_eof() after close() for SelectorSocketTransport (GH-7149) (GH-7153)
Fixed bug where calling write_eof() on a _SelectorSocketTransport after
it's already closed raises AttributeError.
(cherry picked from commit 23f587e395
)
Co-authored-by: twisteroid ambassador <twisteroidambassador@users.noreply.github.com>
This commit is contained in:
parent
51d0a2c8dd
commit
1f21ae710d
3 changed files with 9 additions and 1 deletions
|
@ -899,7 +899,7 @@ class _SelectorSocketTransport(_SelectorTransport):
|
|||
self._sock.shutdown(socket.SHUT_WR)
|
||||
|
||||
def write_eof(self):
|
||||
if self._eof:
|
||||
if self._closing or self._eof:
|
||||
return
|
||||
self._eof = True
|
||||
if not self._buffer:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue