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

Class AuditedLock

tests/test_fork_coordination.py:207–215  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

205 event: Literal["os.fork", "os.forkpty", "_posixsubprocess.fork_exec"],
206) -> None:
207 class AuditedLock(BaseFileLock):
208 def _acquire(self) -> None:
209 self._context.lock_file_fd = None
210 if event == "_posixsubprocess.fork_exec":
211 sys.audit(event, (), (), None)
212 else:
213 sys.audit(event)
214
215 _release = _acquire
216
217 with pytest.raises(RuntimeError, match="unsafe while filelock is changing descriptor ownership"):
218 AuditedLock(str(tmp_path / "audit.lock"), is_singleton=False).acquire(timeout=0)

Calls

no outgoing calls