File tree Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -277,15 +277,16 @@ cdef class UVSocketHandle(UVHandle):
277
277
# Python sockets, i.e. with `loop.create_server(sock=sock)` etc.
278
278
if self ._fileobj is not None :
279
279
if isinstance (self ._fileobj, socket_socket):
280
- # Detaching the socket object is an ideal solution:
281
- # * libuv will actually close the FD
280
+ # Detaching the socket object is the ideal solution:
281
+ # * libuv will actually close the FD;
282
282
# * detach() call will reset FD for the Python socket
283
- # object, which means that it won't be closed 2 times.
283
+ # object, which means that it won't be closed 2nd time
284
+ # when the socket object is GCed.
284
285
self ._fileobj.detach()
285
286
else :
286
287
try :
287
288
# `socket.close()` will raise an EBADF because libuv
288
- # has already closed the underlying FDself .
289
+ # has already closed the underlying FD .
289
290
self ._fileobj.close()
290
291
except OSError as ex:
291
292
if ex.errno != errno_EBADF:
You can’t perform that action at this time.
0 commit comments