(path: str | os.PathLike[str], *, dir_fd: int | None = None)
| 166 | return process_alive(pid) |
| 167 | |
| 168 | def lstat_then_act(path: str | os.PathLike[str], *, dir_fd: int | None = None) -> os.stat_result: |
| 169 | found: Final[os.stat_result] = lstat(path, dir_fd=dir_fd) |
| 170 | if state == ["judged"] and os.fspath(path) == os.fspath(lock): |
| 171 | state.append("acted") |
| 172 | action() |
| 173 | return found |
| 174 | |
| 175 | mocker.patch("filelock._identity._process.process_alive", side_effect=judged, autospec=True) |
| 176 | mocker.patch.object(os, "lstat", new=lstat_then_act) |