Skip to content

Commit 45b4045

Browse files
committed
Fixes
1 parent d69b5f6 commit 45b4045

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

pymongo/network_layer.py

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -236,12 +236,9 @@ async def async_receive_data(
236236
task.cancel()
237237
if len(done) == 0:
238238
raise socket.timeout("timed out")
239-
for task in done:
240-
if task == read_task:
241-
return read_task.result()
242-
else:
243-
raise _OperationCancelled("operation cancelled")
244-
return None # type: ignore[return-value]
239+
if read_task in done:
240+
return read_task.result()
241+
raise _OperationCancelled("operation cancelled")
245242
finally:
246243
sock.settimeout(sock_timeout)
247244

0 commit comments

Comments
 (0)