From b241f6d08a25bbb3f81fb6fcec94cbeeb6baf4b0 Mon Sep 17 00:00:00 2001 From: Noah Stapp Date: Thu, 26 Sep 2024 14:14:00 -0400 Subject: [PATCH] Undo fix --- pymongo/network_layer.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/pymongo/network_layer.py b/pymongo/network_layer.py index a39c192b83..40fbe61b3f 100644 --- a/pymongo/network_layer.py +++ b/pymongo/network_layer.py @@ -238,9 +238,7 @@ async def async_receive_data( raise socket.timeout("timed out") if read_task in done: return read_task.result() - elif conn.cancel_context.cancelled: - raise _OperationCancelled("operation cancelled") - return read_task.result() + raise _OperationCancelled("operation cancelled") finally: sock.settimeout(sock_timeout)