Skip to content

Commit a6ac188

Browse files
committed
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.
1 parent 9aeed6b commit a6ac188

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

sdks/implementations/python/src/stack_auth/_token_store.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@
1616
import threading
1717
import time
1818
from abc import ABC, abstractmethod
19-
from typing import Any, Awaitable, Callable, Literal, Union
19+
from collections.abc import Awaitable, Callable
20+
from typing import Any, Literal
2021

2122
import logging
2223

@@ -219,7 +220,7 @@ def _get_or_create_memory_store(project_id: str) -> MemoryTokenStore:
219220
# TokenStoreInit type and resolver
220221
# ---------------------------------------------------------------------------
221222

222-
TokenStoreInit = Union[Literal["memory"], dict, RequestLike, None]
223+
TokenStoreInit = Literal["memory"] | dict | RequestLike | None
223224

224225

225226
def resolve_token_store(init: TokenStoreInit, project_id: str) -> TokenStore | None:

0 commit comments

Comments
 (0)