File tree Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change 6
6
import os
7
7
import threading
8
8
from contextlib import contextmanager
9
+ from pathlib import Path
9
10
10
11
import filelock
11
12
@@ -35,7 +36,7 @@ def force_unlock(lock_dir: os.PathLike):
35
36
Path to a directory that was locked with `lock_ctx`.
36
37
"""
37
38
38
- fl = filelock .FileLock (os . path . join ( lock_dir , ".lock" ))
39
+ fl = filelock .FileLock (str ( Path ( lock_dir ) / ".lock" ))
39
40
fl .release (force = True )
40
41
41
42
dir_key = f"{ lock_dir } -{ os .getpid ()} "
@@ -72,7 +73,7 @@ def lock_ctx(
72
73
73
74
if dir_key not in local_mem ._locks :
74
75
local_mem ._locks [dir_key ] = True
75
- fl = filelock .FileLock (os . path . join ( lock_dir , ".lock" ))
76
+ fl = filelock .FileLock (str ( Path ( lock_dir ) / ".lock" ))
76
77
fl .acquire (timeout = timeout )
77
78
try :
78
79
yield
You can’t perform that action at this time.
0 commit comments