Skip to content

Commit ff82116

Browse files
committed
Remove os.path in compile/compilelock.py
1 parent 33d7f59 commit ff82116

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

pytensor/compile/compilelock.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
import os
77
import threading
88
from contextlib import contextmanager
9+
from pathlib import Path
910

1011
import filelock
1112

@@ -35,7 +36,7 @@ def force_unlock(lock_dir: os.PathLike):
3536
Path to a directory that was locked with `lock_ctx`.
3637
"""
3738

38-
fl = filelock.FileLock(os.path.join(lock_dir, ".lock"))
39+
fl = filelock.FileLock(Path(lock_dir) / ".lock")
3940
fl.release(force=True)
4041

4142
dir_key = f"{lock_dir}-{os.getpid()}"
@@ -72,7 +73,7 @@ def lock_ctx(
7273

7374
if dir_key not in local_mem._locks:
7475
local_mem._locks[dir_key] = True
75-
fl = filelock.FileLock(os.path.join(lock_dir, ".lock"))
76+
fl = filelock.FileLock(Path(lock_dir) / ".lock")
7677
fl.acquire(timeout=timeout)
7778
try:
7879
yield

0 commit comments

Comments
 (0)