From 207647425292f703ae5cd21e41a980c1cb0d939e Mon Sep 17 00:00:00 2001 From: Ross Williams Date: Wed, 2 Aug 2023 10:56:48 -0400 Subject: [PATCH] Drop use of TypeAlias to maintain Python 3.9 compat TypeAlias annotation was introduced in Python 3.10, and is not strictly necessary. Drop use of it to maintain Python 3.9 compatibility. --- archivebox/extractors/__init__.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/archivebox/extractors/__init__.py b/archivebox/extractors/__init__.py index 5f09931e..38710182 100644 --- a/archivebox/extractors/__init__.py +++ b/archivebox/extractors/__init__.py @@ -4,7 +4,7 @@ import os import sys from pathlib import Path -from typing import Callable, Optional, List, Iterable, TypeAlias, Union +from typing import Callable, Optional, List, Iterable, Union from datetime import datetime, timezone from django.db.models import QuerySet @@ -46,9 +46,9 @@ from .archive_org import should_save_archive_dot_org, save_archive_dot_org from .headers import should_save_headers, save_headers -ShouldSaveFunction: TypeAlias = Callable[[Link, Optional[Path], Optional[bool]], bool] -SaveFunction: TypeAlias = Callable[[Link, Optional[Path], int], ArchiveResult] -ArchiveMethodEntry: TypeAlias = tuple[str, ShouldSaveFunction, SaveFunction] +ShouldSaveFunction = Callable[[Link, Optional[Path], Optional[bool]], bool] +SaveFunction = Callable[[Link, Optional[Path], int], ArchiveResult] +ArchiveMethodEntry = tuple[str, ShouldSaveFunction, SaveFunction] def get_default_archive_methods() -> List[ArchiveMethodEntry]: return [