Skip to content

Commit 83ae4ef

Browse files
committed
stream: Return early in stream._exec_write if the handle is closed
1 parent 0c09984 commit 83ae4ef

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

uvloop/handles/stream.pyx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -373,6 +373,11 @@ cdef class UVStream(UVBaseTransport):
373373
int err
374374
_StreamWriteContext ctx
375375

376+
if self._closed:
377+
# If the handle is closed, just return, it's too
378+
# late to do anything.
379+
return
380+
376381
ctx = _StreamWriteContext.new(self, self._buffer)
377382

378383
if ctx.py_bufs_sml_inuse:

0 commit comments

Comments
 (0)