From 0f18d93e47f745591fc12a432a887238153146c0 Mon Sep 17 00:00:00 2001 From: Kellen <70085049+Kellenn@users.noreply.github.com> Date: Sat, 2 Apr 2022 02:58:39 -0600 Subject: [PATCH] Remove unused imports --- discord/colour.py | 9 +-------- discord/ext/commands/context.py | 2 -- discord/ext/commands/errors.py | 2 +- discord/gateway.py | 2 +- discord/reaction.py | 2 +- discord/role.py | 2 -- discord/types/invite.py | 2 +- discord/ui/modal.py | 1 - discord/widget.py | 2 +- 9 files changed, 6 insertions(+), 18 deletions(-) diff --git a/discord/colour.py b/discord/colour.py index 5308cb74f..761405702 100644 --- a/discord/colour.py +++ b/discord/colour.py @@ -26,14 +26,7 @@ from __future__ import annotations import colorsys import random -from typing import ( - TYPE_CHECKING, - Any, - Callable, - Optional, - Tuple, - Union, -) +from typing import TYPE_CHECKING, Optional, Tuple, Union if TYPE_CHECKING: from typing_extensions import Self diff --git a/discord/ext/commands/context.py b/discord/ext/commands/context.py index eb6b59768..09b63a4e5 100644 --- a/discord/ext/commands/context.py +++ b/discord/ext/commands/context.py @@ -45,10 +45,8 @@ if TYPE_CHECKING: from discord.user import ClientUser, User from discord.voice_client import VoiceProtocol - from .bot import Bot, AutoShardedBot from .cog import Cog from .core import Command - from .help import HelpCommand from .view import StringView # fmt: off diff --git a/discord/ext/commands/errors.py b/discord/ext/commands/errors.py index fc2539658..670eba4e9 100644 --- a/discord/ext/commands/errors.py +++ b/discord/ext/commands/errors.py @@ -24,7 +24,7 @@ DEALINGS IN THE SOFTWARE. from __future__ import annotations -from typing import Optional, Any, TYPE_CHECKING, List, Callable, Type, Tuple, Union +from typing import Optional, Any, TYPE_CHECKING, List, Callable, Tuple, Union from discord.errors import ClientException, DiscordException diff --git a/discord/gateway.py b/discord/gateway.py index dd7884757..db6e7d9cf 100644 --- a/discord/gateway.py +++ b/discord/gateway.py @@ -34,7 +34,7 @@ import threading import traceback import zlib -from typing import Any, Callable, Coroutine, Deque, Dict, List, TYPE_CHECKING, NamedTuple, Optional, TypeVar, Type +from typing import Any, Callable, Coroutine, Deque, Dict, List, TYPE_CHECKING, NamedTuple, Optional, TypeVar import aiohttp diff --git a/discord/reaction.py b/discord/reaction.py index 6bf8a9f45..2a8c7f041 100644 --- a/discord/reaction.py +++ b/discord/reaction.py @@ -23,7 +23,7 @@ DEALINGS IN THE SOFTWARE. """ from __future__ import annotations -from typing import Any, TYPE_CHECKING, AsyncIterator, Union, Optional +from typing import TYPE_CHECKING, AsyncIterator, Union, Optional from .user import User from .object import Object diff --git a/discord/role.py b/discord/role.py index e503b7d08..86b5c9b2f 100644 --- a/discord/role.py +++ b/discord/role.py @@ -37,8 +37,6 @@ __all__ = ( ) if TYPE_CHECKING: - from typing_extensions import Self - import datetime from .types.role import ( Role as RolePayload, diff --git a/discord/types/invite.py b/discord/types/invite.py index 3719135c3..b53ca374c 100644 --- a/discord/types/invite.py +++ b/discord/types/invite.py @@ -25,7 +25,7 @@ DEALINGS IN THE SOFTWARE. from __future__ import annotations from typing import Literal, Optional, TypedDict, Union -from typing_extensions import NotRequired, Required +from typing_extensions import NotRequired from .scheduled_event import GuildScheduledEvent from .snowflake import Snowflake diff --git a/discord/ui/modal.py b/discord/ui/modal.py index 8545a5588..ceb8932f9 100644 --- a/discord/ui/modal.py +++ b/discord/ui/modal.py @@ -28,7 +28,6 @@ import asyncio import logging import os import sys -import time import traceback from copy import deepcopy from typing import TYPE_CHECKING, Any, Dict, Optional, Sequence, ClassVar, List diff --git a/discord/widget.py b/discord/widget.py index 5ea0dcbd5..402cdab82 100644 --- a/discord/widget.py +++ b/discord/widget.py @@ -24,7 +24,7 @@ DEALINGS IN THE SOFTWARE. from __future__ import annotations -from typing import Any, List, Optional, TYPE_CHECKING, Union +from typing import List, Optional, TYPE_CHECKING, Union from .utils import snowflake_time, _get_as_snowflake, resolve_invite from .user import BaseUser