Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions pymongo/network_layer.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@
async def async_sendall(sock: Union[socket.socket, _sslConn], buf: bytes) -> None:
timeout = sock.gettimeout()
sock.settimeout(0.0)
loop = asyncio.get_event_loop()
loop = asyncio.get_running_loop()
try:
if _HAVE_SSL and isinstance(sock, (SSLSocket, _sslConn)):
await asyncio.wait_for(_async_sendall_ssl(sock, buf, loop), timeout=timeout)
Expand Down Expand Up @@ -259,7 +259,7 @@ async def async_receive_data(
timeout = sock_timeout

sock.settimeout(0.0)
loop = asyncio.get_event_loop()
loop = asyncio.get_running_loop()
cancellation_task = create_task(_poll_cancellation(conn))
try:
if _HAVE_SSL and isinstance(sock, (SSLSocket, _sslConn)):
Expand Down Expand Up @@ -290,7 +290,7 @@ async def async_receive_data_socket(
timeout = sock_timeout

sock.settimeout(0.0)
loop = asyncio.get_event_loop()
loop = asyncio.get_running_loop()
try:
if _HAVE_SSL and isinstance(sock, (SSLSocket, _sslConn)):
return await asyncio.wait_for(
Expand Down
Loading