Skip to content

Commit

Permalink
PYTHON-5011 Fix pypy network timeout case
Browse files Browse the repository at this point in the history
  • Loading branch information
ShaneHarvey committed Jan 8, 2025
1 parent 6d2620a commit 9478fb7
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions pymongo/network_layer.py
Original file line number Diff line number Diff line change
Expand Up @@ -388,6 +388,9 @@ def receive_data(conn: Connection, length: int, deadline: Optional[float]) -> me
except socket.timeout:
if conn.cancel_context.cancelled:
raise _OperationCancelled("operation cancelled") from None
if _PYPY:
# We reached the true deadline.
raise
continue
except OSError as exc:
if conn.cancel_context.cancelled:
Expand Down

0 comments on commit 9478fb7

Please sign in to comment.