Skip to content

Commit 5a97fea

Browse files
authored
fix: 🚑 Fix typing.TypeAliasType not present in python <3.12 (#2967)
🚑 Fix `typing.TypeAliasType` not present in python <3.12
1 parent a0f8e75 commit 5a97fea

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

discord/commands/options.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,18 +26,23 @@
2626

2727
import inspect
2828
import logging
29+
import sys
2930
import types
3031
from enum import Enum
3132
from typing import (
3233
TYPE_CHECKING,
3334
Literal,
3435
Optional,
3536
Type,
36-
TypeAliasType,
3737
Union,
3838
get_args,
3939
)
4040

41+
if sys.version_info >= (3, 12):
42+
from typing import TypeAliasType
43+
else:
44+
from typing_extensions import TypeAliasType
45+
4146
from ..abc import GuildChannel, Mentionable
4247
from ..channel import (
4348
CategoryChannel,

0 commit comments

Comments
 (0)