diff --git a/src/HABApp/util/rate_limiter/limiter.py b/src/HABApp/util/rate_limiter/limiter.py index cbed1ae3..487e0c1a 100644 --- a/src/HABApp/util/rate_limiter/limiter.py +++ b/src/HABApp/util/rate_limiter/limiter.py @@ -1,7 +1,7 @@ from dataclasses import dataclass -from typing import Final, List, Literal, Tuple, TypeAlias, Union +from typing import Final, List, Literal, Tuple, Union -from HABApp.core.const.const import StrEnum +from HABApp.core.const.const import PYTHON_310, StrEnum from .limits import ( BaseRateLimit, @@ -13,6 +13,12 @@ from .parser import parse_limit +if PYTHON_310: + from typing import TypeAlias +else: + from typing_extensions import TypeAlias + + class LimitTypeEnum(StrEnum): LEAKY_BUCKET = 'leaky_bucket' FIXED_WINDOW_ELASTIC_EXPIRY = 'fixed_window_elastic_expiry'