From 01553b6d87a3a4569f2a0838bc37134b96cf2ff7 Mon Sep 17 00:00:00 2001 From: Serhii Tereshchenko Date: Wed, 4 Sep 2024 21:26:25 +0300 Subject: [PATCH] Revert "fix: Fix type error for Python 3.8 (#754)" (#757) This reverts commit 5cc37c256f377f918e3f4b788b900a700a5f22db. --- modeltranslation/_typing.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modeltranslation/_typing.py b/modeltranslation/_typing.py index d955ca3c..8ad4d728 100644 --- a/modeltranslation/_typing.py +++ b/modeltranslation/_typing.py @@ -1,7 +1,7 @@ from __future__ import annotations import sys -from typing import Literal, TypeVar +from typing import Literal, TypeVar, Union from django.contrib import admin from django.contrib.admin.options import BaseModelAdmin @@ -16,7 +16,7 @@ _K = TypeVar("_K") # See https://github.com/typeddjango/django-stubs/blob/082955/django-stubs/utils/datastructures.pyi#L12-L14 -_ListOrTuple: TypeAlias = "list[_K] | tuple[_K, ...]" +_ListOrTuple: TypeAlias = Union[list[_K], tuple[_K, ...]] # https://github.com/typeddjango/django-stubs/tree/master/django_stubs_ext