From 758d1fea1be40d6c399510a3fbc06d10b51eb8c6 Mon Sep 17 00:00:00 2001 From: Frederik Haarslev Date: Fri, 22 Dec 2023 15:29:52 +0100 Subject: [PATCH] Fix type hints for python 3.7-3.9 --- src/mediacatch_s2t/uploader.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/mediacatch_s2t/uploader.py b/src/mediacatch_s2t/uploader.py index 8432d46..7dff8dd 100644 --- a/src/mediacatch_s2t/uploader.py +++ b/src/mediacatch_s2t/uploader.py @@ -39,7 +39,7 @@ class Uploader: CHUNK_SIZE = 100 * 1024 * 1024 # 100 MB REQUEST_RETRY_LIMIT = 3 - def __init__(self, file: str, api_key: str, quota: str | None = None, max_threads: int = 5) -> None: + def __init__(self, file: str, api_key: str, quota: Optional[str] = None, max_threads: int = 5) -> None: self.file_path = Path(file) if not self.file_path.is_file(): raise FileNotFoundError(f"The file {file} does not exist") @@ -201,7 +201,7 @@ def _is_response_successful(response: requests.Response) -> bool: """ return 200 <= response.status_code < 300 -def upload_and_get_transcription(file: str, api_key: str, quota: str | None = None) -> dict[str, str]: +def upload_and_get_transcription(file: str, api_key: str, quota: Optional[str] = None) -> dict[str, str]: """Uploads a file and returns its transcription. Args: