fix: Fix type error for Python 3.8 (#754)

Closes #753
This commit is contained in:
Serhii Tereshchenko 2024-08-13 11:08:42 +03:00 committed by GitHub
parent 6fdcdfe612
commit 5cc37c256f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -1,7 +1,7 @@
from __future__ import annotations
import sys
from typing import Literal, TypeVar, Union
from typing import Literal, TypeVar
from django.contrib import admin
from django.contrib.admin.options import BaseModelAdmin
@ -16,7 +16,7 @@ AutoPopulate: TypeAlias = "bool | Literal['all', 'default', 'required']"
_K = TypeVar("_K")
# See https://github.com/typeddjango/django-stubs/blob/082955/django-stubs/utils/datastructures.pyi#L12-L14
_ListOrTuple: TypeAlias = Union[list[_K], tuple[_K, ...]]
_ListOrTuple: TypeAlias = "list[_K] | tuple[_K, ...]"
# https://github.com/typeddjango/django-stubs/tree/master/django_stubs_ext