aboutsummaryrefslogtreecommitdiffstats
path: root/pydis_core
diff options
context:
space:
mode:
authorGravatar Chris Lovering <[email protected]>2023-03-02 22:31:58 +0000
committerGravatar ChrisJL <[email protected]>2023-03-02 22:57:53 +0000
commit247e6a3c7b93a27a49f851bf0740016ad4f4fb3f (patch)
tree1a2d53014b394a9793d5a04ffca2f29106c2de17 /pydis_core
parentDon't override the default list of ignored flake8 rules (diff)
Explicitly set the stack level of the warnings.warn call
The warn method from the warnings module uses a stacklevel of 1 by default. This will only show a stack trace for the line on which the warn method is called. It is therefore recommended to use a stacklevel of 2 or greater to provide more information to the user.
Diffstat (limited to 'pydis_core')
-rw-r--r--pydis_core/_bot.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/pydis_core/_bot.py b/pydis_core/_bot.py
index 09ab2a63..0d0682f7 100644
--- a/pydis_core/_bot.py
+++ b/pydis_core/_bot.py
@@ -73,7 +73,7 @@ class BotBase(commands.Bot):
self.statsd_url = statsd_url
if redis_session and not REDIS_AVAILABLE:
- warnings.warn("redis_session kwarg passed, but async-rediscache not installed!")
+ warnings.warn("redis_session kwarg passed, but async-rediscache not installed!", stacklevel=2)
elif redis_session:
self.redis_session = redis_session