Skip to content

Commit

Permalink
style fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
hwikle-lanl committed Jan 31, 2024
1 parent a987d76 commit afc4c18
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lib/pavilion/lockfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -349,13 +349,13 @@ def __enter__(self):

if self._get_earliest() == self._lockfile:
return self
def __exit__(self):

def __exit__(self, exc_type, exc_val, exc_tb):
self.lockfile.unlink()

def _get_earliest(self) -> Path:
"""Return the path to the lockfile that was created first."""
lockfiles = self._lock_dir.iterdir()

# Sort files by creation time, and return oldest
return sorted(lockfiles, key=lambda x: x.stat().st_ctime)[0]
return sorted(lockfiles, key=lambda x: x.stat().st_ctime)[0]

0 comments on commit afc4c18

Please sign in to comment.