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

Function _interrupt_points

tests/core/test_interruption.py:60–67  ·  view source on GitHub ↗
(lock: BaseFileLock, operation: Callable[[], object], *, callee: CodeType | None = None)

Source from the content-addressed store, hash-verified

58
59
60def _interrupt_points(lock: BaseFileLock, operation: Callable[[], object], *, callee: CodeType | None = None) -> int:
61 points: Final[list[None]] = []
62 sys.setprofile(_interrupt_hook(lock, callee, lambda: points.append(None)))
63 try:
64 operation()
65 finally:
66 sys.setprofile(None)
67 return len(points)
68
69
70def _interrupt_hook(

Calls 1

_interrupt_hookFunction · 0.85

Tested by

no test coverage detected