refactor: use modern Python 3.10+ imports in token store module

Move Awaitable and Callable imports to collections.abc per PEP 585.
Replace Union type alias with pipe syntax for TokenStoreInit.
This commit is contained in:
Ejiro Asiuwhu 2026-03-26 11:14:43 +01:00
parent 9aeed6b366
commit a6ac1889e1

View File

@ -16,7 +16,8 @@ import json
import threading
import time
from abc import ABC, abstractmethod
from typing import Any, Awaitable, Callable, Literal, Union
from collections.abc import Awaitable, Callable
from typing import Any, Literal
import logging
@ -219,7 +220,7 @@ def _get_or_create_memory_store(project_id: str) -> MemoryTokenStore:
# TokenStoreInit type and resolver
# ---------------------------------------------------------------------------
TokenStoreInit = Union[Literal["memory"], dict, RequestLike, None]
TokenStoreInit = Literal["memory"] | dict | RequestLike | None
def resolve_token_store(init: TokenStoreInit, project_id: str) -> TokenStore | None: