From a6ac1889e1bb2f811545cb51d02941eb3dbbee5f Mon Sep 17 00:00:00 2001 From: Ejiro Asiuwhu Date: Thu, 26 Mar 2026 11:14:43 +0100 Subject: [PATCH] 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. --- sdks/implementations/python/src/stack_auth/_token_store.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/sdks/implementations/python/src/stack_auth/_token_store.py b/sdks/implementations/python/src/stack_auth/_token_store.py index 1159de7ae..d239007f0 100644 --- a/sdks/implementations/python/src/stack_auth/_token_store.py +++ b/sdks/implementations/python/src/stack_auth/_token_store.py @@ -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: