Skip to content

Commit 7705b3e

Browse files
Add str to lock_dir types in aesara.compile.compilelock.lock_ctx
1 parent 77f0df8 commit 7705b3e

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

aesara/compile/compilelock.py

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
import os
66
import threading
77
from contextlib import contextmanager
8-
from typing import Optional
8+
from typing import Optional, Union
99

1010
import filelock
1111

@@ -45,17 +45,19 @@ def force_unlock(lock_dir: os.PathLike):
4545

4646

4747
@contextmanager
48-
def lock_ctx(lock_dir: os.PathLike = None, *, timeout: Optional[float] = None):
48+
def lock_ctx(
49+
lock_dir: Union[str, os.PathLike] = None, *, timeout: Optional[float] = None
50+
):
4951
"""Context manager that wraps around FileLock and SoftFileLock from filelock package.
5052
5153
Parameters
5254
----------
53-
lock_dir : str
55+
lock_dir
5456
A directory for which to acquire the lock.
55-
Defaults to the config.compiledir.
56-
timeout : float
57+
Defaults to `aesara.config.compiledir`.
58+
timeout
5759
Timeout in seconds for waiting in lock acquisition.
58-
Defaults to config.compile__timeout.
60+
Defaults to `aesara.config.compile__timeout`.
5961
"""
6062
if lock_dir is None:
6163
lock_dir = config.compiledir

0 commit comments

Comments
 (0)