From e28b42f9b1e085df6961d195abe6a36210d25242 Mon Sep 17 00:00:00 2001 From: Hassan Abouelela Date: Wed, 11 May 2022 02:39:41 +0400 Subject: Remove Discord `MissingSentinel` Replaces the access to `discord.utils._MissingSentinel` with a simple boolean flag. This has the benefit of behaving more nicely with our doc generation. Signed-off-by: Hassan Abouelela --- botcore/_bot.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'botcore') diff --git a/botcore/_bot.py b/botcore/_bot.py index a36dba15..e9eba5c5 100644 --- a/botcore/_bot.py +++ b/botcore/_bot.py @@ -17,8 +17,10 @@ from botcore.utils.logging import get_logger try: from async_rediscache import RedisSession + REDIS_AVAILABLE = True except ImportError: - RedisSession = discord.utils._MissingSentinel + RedisSession = None + REDIS_AVAILABLE = False log = get_logger() @@ -70,7 +72,7 @@ class BotBase(commands.Bot): self.api_client = api_client self.statsd_url = statsd_url - if redis_session and RedisSession == discord.utils._MissingSentinel: + if redis_session and not REDIS_AVAILABLE: warnings.warn("redis_session kwarg passed, but async-rediscache not installed!") elif redis_session: self.redis_session = redis_session -- cgit v1.2.3