mirror of
https://github.com/Cog-Creators/Red-DiscordBot.git
synced 2025-11-07 11:48:55 -05:00
[V3] Use typing.TYPE_CHECKING instead of utils.TYPE_CHECKING (#1778)
Not needed any more as we no longer support python<3.6
This commit is contained in:
parent
8610b47a68
commit
19b05e632c
@ -3,9 +3,8 @@ import distutils.dir_util
|
||||
import shutil
|
||||
from enum import Enum
|
||||
from pathlib import Path
|
||||
from typing import MutableMapping, Any
|
||||
from typing import MutableMapping, Any, TYPE_CHECKING
|
||||
|
||||
from redbot.core.utils import TYPE_CHECKING
|
||||
from .log import log
|
||||
from .json_mixins import RepoJSONMixin
|
||||
|
||||
|
||||
@ -1,15 +1,13 @@
|
||||
import logging
|
||||
import collections
|
||||
from copy import deepcopy
|
||||
from typing import Union, Tuple
|
||||
from typing import Union, Tuple, TYPE_CHECKING
|
||||
|
||||
import discord
|
||||
|
||||
from .data_manager import cog_data_path, core_data_path
|
||||
from .drivers import get_driver
|
||||
|
||||
from .utils import TYPE_CHECKING
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from .drivers.red_base import BaseDriver
|
||||
|
||||
|
||||
@ -13,6 +13,7 @@ from pathlib import Path
|
||||
from random import SystemRandom
|
||||
from string import ascii_letters, digits
|
||||
from distutils.version import StrictVersion
|
||||
from typing import TYPE_CHECKING
|
||||
|
||||
import aiohttp
|
||||
import discord
|
||||
@ -21,9 +22,7 @@ import pkg_resources
|
||||
from redbot.core import __version__
|
||||
from redbot.core import checks
|
||||
from redbot.core import i18n
|
||||
from redbot.core import rpc
|
||||
from redbot.core import commands
|
||||
from .utils import TYPE_CHECKING
|
||||
from .utils.chat_formatting import pagify, box, inline
|
||||
|
||||
if TYPE_CHECKING:
|
||||
|
||||
@ -9,10 +9,6 @@ import logging
|
||||
import appdirs
|
||||
|
||||
from .json_io import JsonIO
|
||||
from .utils import TYPE_CHECKING
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from . import Config
|
||||
|
||||
__all__ = [
|
||||
"load_basic_configuration",
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
__all__ = ["TYPE_CHECKING", "NewType", "safe_delete", "fuzzy_command_search"]
|
||||
__all__ = ["safe_delete", "fuzzy_command_search"]
|
||||
|
||||
from pathlib import Path
|
||||
import os
|
||||
@ -7,18 +7,6 @@ from redbot.core import commands
|
||||
from fuzzywuzzy import process
|
||||
from .chat_formatting import box
|
||||
|
||||
try:
|
||||
from typing import TYPE_CHECKING
|
||||
except ImportError:
|
||||
TYPE_CHECKING = False
|
||||
|
||||
try:
|
||||
from typing import NewType
|
||||
except ImportError:
|
||||
|
||||
def NewType(name, tp):
|
||||
return type(name, (tp,), {})
|
||||
|
||||
|
||||
def safe_delete(pth: Path):
|
||||
if pth.exists():
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user