MCPcopy Create free account
hub / github.com/tox-dev/filelock / _unsupported_async_options

Function _unsupported_async_options

tests/test_subclass_options.py:243–254  ·  view source on GitHub ↗
(
    option: Literal["thread_local", "loop", "run_in_executor", "executor"],
    loop: asyncio.AbstractEventLoop,
    executor: Executor,
)

Source from the content-addressed store, hash-verified

241
242
243def _unsupported_async_options(
244 option: Literal["thread_local", "loop", "run_in_executor", "executor"],
245 loop: asyncio.AbstractEventLoop,
246 executor: Executor,
247) -> _AsyncFileLockOptions:
248 if option == "thread_local":
249 return {"thread_local": True, "run_in_executor": False}
250 if option == "loop":
251 return {"loop": loop}
252 if option == "run_in_executor":
253 return {"run_in_executor": False}
254 return {"executor": executor}
255
256
257def _build_with_explicit_defaults(kind: Literal["sync", "async"], lock_path: str) -> BaseFileLock:

Calls

no outgoing calls

Tested by

no test coverage detected