Skip to content

Commit 7a59a36

Browse files
committed
Import override from typing_extensions
1 parent a652aaa commit 7a59a36

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

chess/engine.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,9 @@
2424
from types import TracebackType
2525
from typing import Any, Callable, Coroutine, Deque, Dict, Generator, Generic, Iterable, Iterator, List, Literal, Mapping, MutableMapping, Optional, Tuple, Type, TypedDict, TypeVar, Union
2626

27-
try:
28-
from typing import override
29-
except:
30-
# Before Python 3.12
27+
if typing.TYPE_CHECKING:
28+
from typing_extensions import override
29+
else:
3130
F = typing.TypeVar("F", bound=Callable[..., Any])
3231
def override(fn: F, /) -> F:
3332
return fn

0 commit comments

Comments
 (0)