From 94b3f6ef53eb57a0b8236301467ae375735a6460 Mon Sep 17 00:00:00 2001 From: Tom Christie Date: Thu, 27 Mar 2025 18:06:05 +0000 Subject: [PATCH] Revert "Use AnyIO fast_acquire (#953)" This reverts commit 973cbdd1050302822f17893c951ca5a1a729dc13. --- httpcore/_synchronization.py | 4 ++-- pyproject.toml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/httpcore/_synchronization.py b/httpcore/_synchronization.py index 10fe7df8..2ecc9e9c 100644 --- a/httpcore/_synchronization.py +++ b/httpcore/_synchronization.py @@ -65,7 +65,7 @@ def setup(self) -> None: if self._backend == "trio": self._trio_lock = trio.Lock() elif self._backend == "asyncio": - self._anyio_lock = anyio.Lock(fast_acquire=True) + self._anyio_lock = anyio.Lock() async def __aenter__(self) -> AsyncLock: if not self._backend: @@ -168,7 +168,7 @@ def setup(self) -> None: ) elif self._backend == "asyncio": self._anyio_semaphore = anyio.Semaphore( - initial_value=self._bound, max_value=self._bound, fast_acquire=True + initial_value=self._bound, max_value=self._bound ) async def acquire(self) -> None: diff --git a/pyproject.toml b/pyproject.toml index cca12b9d..d6573dd8 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -44,7 +44,7 @@ trio = [ "trio>=0.22.0,<1.0", ] asyncio = [ - "anyio>=4.5.0,<5.0", + "anyio>=4.0,<5.0", ] [project.urls]