Skip to content

Commit ce4eeb2

Browse files
committed
PYTHON-5167 Shield wait() from wait_for cancel
1 parent 67759cd commit ce4eeb2

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

pymongo/lock.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ def _release_locks() -> None:
8484
async def _async_cond_wait(condition: Condition, timeout: Optional[float]) -> bool:
8585
fut = asyncio.ensure_future(condition.wait())
8686
try:
87-
return await wait_for(fut, timeout)
87+
return await wait_for(asyncio.shield(fut), timeout)
8888
except asyncio.TimeoutError:
8989
await fut
9090
return False

0 commit comments

Comments
 (0)