| 68 | |
| 69 | |
| 70 | class AsyncFileLockMeta(FileLockMeta): |
| 71 | def __call__( # type: ignore[override] # noqa: PLR0913 |
| 72 | cls, # noqa: N805 |
| 73 | lock_file: str | os.PathLike[str], |
| 74 | timeout: float = -1, |
| 75 | mode: int = 0o644, |
| 76 | thread_local: bool = False, # noqa: FBT001, FBT002 |
| 77 | *, |
| 78 | blocking: bool = True, |
| 79 | is_singleton: bool = False, |
| 80 | loop: asyncio.AbstractEventLoop | None = None, |
| 81 | run_in_executor: bool = True, |
| 82 | executor: futures.Executor | None = None, |
| 83 | ) -> BaseAsyncFileLock: |
| 84 | if thread_local and run_in_executor: |
| 85 | msg = "run_in_executor is not supported when thread_local is True" |
| 86 | raise ValueError(msg) |
| 87 | instance = super().__call__( |
| 88 | lock_file=lock_file, |
| 89 | timeout=timeout, |
| 90 | mode=mode, |
| 91 | thread_local=thread_local, |
| 92 | blocking=blocking, |
| 93 | is_singleton=is_singleton, |
| 94 | loop=loop, |
| 95 | run_in_executor=run_in_executor, |
| 96 | executor=executor, |
| 97 | ) |
| 98 | return cast(BaseAsyncFileLock, instance) |
| 99 | |
| 100 | |
| 101 | class BaseAsyncFileLock(BaseFileLock, metaclass=AsyncFileLockMeta): |
nothing calls this directly
no outgoing calls
no test coverage detected