fix: mypy issue on py3.9 + prevent similar issues (#29864)

This commit is contained in:
Maxime Beauchemin
2024-08-06 10:36:23 -07:00
committed by GitHub
parent fede4f9f1b
commit c7dc4dc7fc
4 changed files with 12 additions and 4 deletions

View File

@@ -17,7 +17,7 @@
import logging
import uuid
from typing import Any
from typing import Any, Union
from flask import current_app
@@ -34,7 +34,7 @@ class BaseDistributedLockCommand(BaseCommand):
codec = JsonKeyValueCodec()
resource = KeyValueResource.LOCK
def __init__(self, namespace: str, params: dict[str, Any] | None = None):
def __init__(self, namespace: str, params: Union[dict[str, Any], None] = None):
self.key = get_key(namespace, **(params or {}))
def validate(self) -> None: