filelock: fix type annotation

Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
This commit is contained in:
Eric Callahan 2024-04-27 11:08:18 -04:00
parent 379a26600c
commit 7394a22c2d
No known key found for this signature in database
GPG Key ID: 5A1EB336DFB4C71B
1 changed files with 2 additions and 2 deletions

View File

@ -13,7 +13,7 @@ import pathlib
import contextlib
import asyncio
from . import ServerError
from typing import Optional, Type
from typing import Optional, Type, Union
from types import TracebackType
class LockTimeout(ServerError):
@ -21,7 +21,7 @@ class LockTimeout(ServerError):
class AsyncExclusiveFileLock(contextlib.AbstractAsyncContextManager):
def __init__(
self, file_path: pathlib.Path, timeout: int = 0
self, file_path: pathlib.Path, timeout: Union[int, float] = 0
) -> None:
self.lock_path = file_path.parent.joinpath(f".{file_path.name}.lock")
self.timeout = timeout