Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion agent/shell_hooks.py
Original file line number Diff line number Diff line change
Expand Up @@ -624,7 +624,10 @@ def _locked_update_approvals() -> Iterator[Dict[str, Any]]:
yield data
save_allowlist(data)
finally:
fcntl.flock(lock_fh.fileno(), fcntl.LOCK_UN)
try:
fcntl.flock(lock_fh.fileno(), fcntl.LOCK_UN)
except OSError:
pass


def _prompt_and_record(
Expand Down
5 changes: 4 additions & 1 deletion hermes_cli/auth.py
Original file line number Diff line number Diff line change
Expand Up @@ -914,7 +914,10 @@ def _file_lock(
finally:
holder.depth = 0
if fcntl:
fcntl.flock(lock_file.fileno(), fcntl.LOCK_UN)
try:
fcntl.flock(lock_file.fileno(), fcntl.LOCK_UN)
except OSError:
pass
elif msvcrt:
try:
lock_file.seek(0)
Expand Down
5 changes: 4 additions & 1 deletion tools/environments/file_sync.py
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,10 @@ def _sync_back_locked(self, lock_path: Path) -> None:
fcntl.flock(lock_fd, fcntl.LOCK_EX)
self._sync_back_impl()
finally:
fcntl.flock(lock_fd, fcntl.LOCK_UN)
try:
fcntl.flock(lock_fd, fcntl.LOCK_UN)
except OSError:
pass
lock_fd.close()

def _sync_back_impl(self) -> None:
Expand Down
5 changes: 4 additions & 1 deletion tools/memory_tool.py
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,10 @@ def _file_lock(path: Path):
yield
finally:
if fcntl:
fcntl.flock(fd, fcntl.LOCK_UN)
try:
fcntl.flock(fd, fcntl.LOCK_UN)
except OSError:
pass
elif msvcrt:
try:
fd.seek(0)
Expand Down
5 changes: 4 additions & 1 deletion tools/skill_usage.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,10 @@ def _usage_file_lock():
yield
finally:
if fcntl:
fcntl.flock(fd, fcntl.LOCK_UN)
try:
fcntl.flock(fd, fcntl.LOCK_UN)
except OSError:
pass
elif msvcrt:
try:
fd.seek(0)
Expand Down