From 7394a22c2d3fa3e36cd79c7ac955bde7f9239c94 Mon Sep 17 00:00:00 2001 From: Eric Callahan Date: Sat, 27 Apr 2024 11:08:18 -0400 Subject: [PATCH] filelock: fix type annotation Signed-off-by: Eric Callahan --- moonraker/utils/filelock.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/moonraker/utils/filelock.py b/moonraker/utils/filelock.py index cdab0d0..7cc82de 100644 --- a/moonraker/utils/filelock.py +++ b/moonraker/utils/filelock.py @@ -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