Browse Source

[chore] Remove redundant imports

This also removes the historical patch for NullHandler implemented in bbf1c54, as it has been available since Python 3.1.
pull/6098/head
Nadir Chowdhury 4 years ago
committed by GitHub
parent
commit
6b803acde4
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 9
      discord/__init__.py
  2. 2
      discord/abc.py
  3. 2
      discord/client.py
  4. 3
      discord/ext/commands/bot.py
  5. 3
      discord/guild.py
  6. 2
      discord/iterators.py
  7. 2
      discord/member.py
  8. 1
      discord/message.py
  9. 2
      discord/state.py
  10. 2
      discord/utils.py

9
discord/__init__.py

@ -64,11 +64,4 @@ VersionInfo = namedtuple('VersionInfo', 'major minor micro releaselevel serial')
version_info = VersionInfo(major=1, minor=6, micro=0, releaselevel='alpha', serial=0)
try:
from logging import NullHandler
except ImportError:
class NullHandler(logging.Handler):
def emit(self, record):
pass
logging.getLogger(__name__).addHandler(NullHandler())
logging.getLogger(__name__).addHandler(logging.NullHandler())

2
discord/abc.py

@ -32,7 +32,7 @@ import asyncio
from .iterators import HistoryIterator
from .context_managers import Typing
from .enums import ChannelType
from .errors import InvalidArgument, ClientException, HTTPException
from .errors import InvalidArgument, ClientException
from .permissions import PermissionOverwrite, Permissions
from .role import Role
from .invite import Invite

2
discord/client.py

@ -33,14 +33,12 @@ import traceback
import aiohttp
from .user import User, Profile
from .asset import Asset
from .invite import Invite
from .template import Template
from .widget import Widget
from .guild import Guild
from .channel import _channel_factory
from .enums import ChannelType
from .member import Member
from .mentions import AllowedMentions
from .errors import *
from .enums import Status, VoiceRegion

3
discord/ext/commands/bot.py

@ -30,12 +30,11 @@ import inspect
import importlib.util
import sys
import traceback
import re
import types
import discord
from .core import GroupMixin, Command
from .core import GroupMixin
from .view import StringView
from .context import Context
from . import errors

3
discord/guild.py

@ -30,14 +30,13 @@ from collections import namedtuple
from . import utils
from .role import Role
from .member import Member, VoiceState
from .activity import create_activity
from .emoji import Emoji
from .errors import InvalidData
from .permissions import PermissionOverwrite
from .colour import Colour
from .errors import InvalidArgument, ClientException
from .channel import *
from .enums import VoiceRegion, Status, ChannelType, try_enum, VerificationLevel, ContentFilter, NotificationLevel
from .enums import VoiceRegion, ChannelType, try_enum, VerificationLevel, ContentFilter, NotificationLevel
from .mixins import Hashable
from .user import User
from .invite import Invite

2
discord/iterators.py

@ -28,7 +28,7 @@ import asyncio
import datetime
from .errors import NoMoreItems
from .utils import DISCORD_EPOCH, time_snowflake, maybe_coroutine
from .utils import time_snowflake, maybe_coroutine
from .object import Object
from .audit_logs import AuditLogEntry

2
discord/member.py

@ -34,7 +34,7 @@ from . import utils
from .user import BaseUser, User
from .activity import create_activity
from .permissions import Permissions
from .enums import Status, try_enum, UserFlags, HypeSquadHouse
from .enums import Status, try_enum
from .colour import Colour
from .object import Object

1
discord/message.py

@ -43,7 +43,6 @@ from .file import File
from .utils import escape_mentions
from .guild import Guild
from .mixins import Hashable
from .mentions import AllowedMentions
from .sticker import Sticker
__all__ = (

2
discord/state.py

@ -30,7 +30,6 @@ import copy
import datetime
import itertools
import logging
import math
import weakref
import warnings
import inspect
@ -53,7 +52,6 @@ from .role import Role
from .enums import ChannelType, try_enum, Status
from . import utils
from .flags import Intents, MemberCacheFlags
from .embeds import Embed
from .object import Object
from .invite import Invite

2
discord/utils.py

@ -31,7 +31,6 @@ import unicodedata
from base64 import b64encode
from bisect import bisect_left
import datetime
from email.utils import parsedate_to_datetime
import functools
from inspect import isawaitable as _isawaitable
from operator import attrgetter
@ -40,7 +39,6 @@ import re
import warnings
from .errors import InvalidArgument
from .object import Object
DISCORD_EPOCH = 1420070400000
MAX_ASYNCIO_SECONDS = 3456000

Loading…
Cancel
Save