Skip to content

Commit 247e6a3

Browse files
committed
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.
1 parent 4aebfae commit 247e6a3

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

pydis_core/_bot.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ def __init__(
7373
self.statsd_url = statsd_url
7474

7575
if redis_session and not REDIS_AVAILABLE:
76-
warnings.warn("redis_session kwarg passed, but async-rediscache not installed!")
76+
warnings.warn("redis_session kwarg passed, but async-rediscache not installed!", stacklevel=2)
7777
elif redis_session:
7878
self.redis_session = redis_session
7979

0 commit comments

Comments
 (0)