We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 33d7f59 commit ff82116Copy full SHA for ff82116
pytensor/compile/compilelock.py
@@ -6,6 +6,7 @@
6
import os
7
import threading
8
from contextlib import contextmanager
9
+from pathlib import Path
10
11
import filelock
12
@@ -35,7 +36,7 @@ def force_unlock(lock_dir: os.PathLike):
35
36
Path to a directory that was locked with `lock_ctx`.
37
"""
38
- fl = filelock.FileLock(os.path.join(lock_dir, ".lock"))
39
+ fl = filelock.FileLock(Path(lock_dir) / ".lock")
40
fl.release(force=True)
41
42
dir_key = f"{lock_dir}-{os.getpid()}"
@@ -72,7 +73,7 @@ def lock_ctx(
72
73
74
if dir_key not in local_mem._locks:
75
local_mem._locks[dir_key] = True
76
77
fl.acquire(timeout=timeout)
78
try:
79
yield
0 commit comments