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

Function take_from_cache

tests/async_lock/test_finalization.py:221–226  ·  view source on GitHub ↗
(frame: FrameType, event: str, _arg: Unused)

Source from the content-addressed store, hash-verified

219 # The cache still finds a lock whose finalizer is starting, as another thread asking at that moment would.
220 # Interpreters run a profile hook with tracing off, so coverage does not record its body.
221 def take_from_cache(frame: FrameType, event: str, _arg: Unused) -> None: # pragma: no cover
222 if event == "call" and frame.f_code is BaseFileLock.__del__.__code__ and not handed_out:
223 handed_out.append(
224 AsyncFileLock(lock_path, is_singleton=True, thread_local=thread_local, run_in_executor=False)
225 )
226 asyncio.run(handed_out[0].acquire())
227
228 sys.setprofile(take_from_cache)
229 try:

Callers

nothing calls this directly

Calls 2

runMethod · 0.45
acquireMethod · 0.45

Tested by

no test coverage detected