mirror of
https://github.com/stack-auth/stack.git
synced 2026-07-20 21:29:36 +08:00
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:
parent
9aeed6b366
commit
a6ac1889e1
@ -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:
|
||||
|
||||
Loading…
Reference in New Issue
Block a user