mirror of
https://github.com/pirate/ArchiveBox.git
synced 2025-08-13 10:04:31 +02:00
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.
This commit is contained in:
@@ -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 [
|
||||
|
Reference in New Issue
Block a user