mirror of
https://github.com/python/cpython.git
synced 2025-08-30 13:38:43 +00:00
gh-113892: Add a extra check to ProactorEventLoop.sock_connect
to ensure that the given socket is in non-blocking mode (#119519)
This commit is contained in:
parent
ce2ea7d629
commit
cf3bba3f06
3 changed files with 12 additions and 2 deletions
|
@ -721,6 +721,8 @@ class BaseProactorEventLoop(base_events.BaseEventLoop):
|
|||
return await self._proactor.sendto(sock, data, 0, address)
|
||||
|
||||
async def sock_connect(self, sock, address):
|
||||
if self._debug and sock.gettimeout() != 0:
|
||||
raise ValueError("the socket must be non-blocking")
|
||||
return await self._proactor.connect(sock, address)
|
||||
|
||||
async def sock_accept(self, sock):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue