From 7a59a3683f33682c0c2c9b359469c8b9876ece9e Mon Sep 17 00:00:00 2001 From: Niklas Fiekas Date: Wed, 31 Jul 2024 17:02:12 +0200 Subject: [PATCH] Import override from typing_extensions --- chess/engine.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/chess/engine.py b/chess/engine.py index f5fdff96..347acf29 100644 --- a/chess/engine.py +++ b/chess/engine.py @@ -24,10 +24,9 @@ from types import TracebackType from typing import Any, Callable, Coroutine, Deque, Dict, Generator, Generic, Iterable, Iterator, List, Literal, Mapping, MutableMapping, Optional, Tuple, Type, TypedDict, TypeVar, Union -try: - from typing import override -except: - # Before Python 3.12 +if typing.TYPE_CHECKING: + from typing_extensions import override +else: F = typing.TypeVar("F", bound=Callable[..., Any]) def override(fn: F, /) -> F: return fn