Skip to content

Commit

Permalink
fixed typing for legacy python version
Browse files Browse the repository at this point in the history
  • Loading branch information
cloutierMat committed Oct 4, 2024
1 parent 140e724 commit bd18d5a
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions moto/utilities/id_generator.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import threading
from typing import Any, Callable
from typing import Any, Callable, Dict, List, Union

from moto.moto_api._internal import mock_random

Expand All @@ -11,7 +11,7 @@ class MotoIdManager:
use the `id_manager` instance created below."""

_custom_ids: dict[str, str]
_id_sources: list[IdSource]
_id_sources: List[IdSource]

_lock: threading.RLock

Expand All @@ -24,7 +24,7 @@ def __init__(self) -> None:

def get_custom_id(
self, account_id: str, region: str, service: str, resource: str, name: str
) -> str | None:
) -> Union[str, None]:
# retrieves a custom_id for a resource. Returns None
return self._custom_ids.get(
".".join([account_id, region, service, resource, name])
Expand Down Expand Up @@ -59,7 +59,7 @@ def add_id_source(self, id_source: IdSource) -> None:

def find_id_from_sources(
self, account_id: str, region: str, service: str, resource: str, name: str
) -> str | None:
) -> Union[str, None]:
for id_source in self._id_sources:
if found_id := id_source(account_id, region, service, resource, name):
return found_id
Expand All @@ -77,7 +77,7 @@ def _wrapper(
service: str,
resource: str,
name: str,
**kwargs: dict[str, Any],
**kwargs: Dict[str, Any],
) -> str:
if found_id := id_manager.find_id_from_sources(
account_id, region, service, resource, name
Expand Down

0 comments on commit bd18d5a

Please sign in to comment.