| 180 | acquired = released = False |
| 181 | |
| 182 | class AioFileLock(BaseAsyncFileLock): |
| 183 | async def _acquire(self) -> None: # ty: ignore[invalid-method-override] |
| 184 | nonlocal acquired |
| 185 | acquired = True |
| 186 | self._context.lock_file_fd = 1 |
| 187 | |
| 188 | async def _release(self) -> None: # ty: ignore[invalid-method-override] |
| 189 | nonlocal released |
| 190 | released = True |
| 191 | self._context.lock_file_fd = None |
| 192 | |
| 193 | lock = AioFileLock(str(tmp_path / "a")) |
| 194 | await lock.acquire() |
no outgoing calls