Fix stacklevel for Message.interaction deprecation warning

This commit is contained in:
Jakub Kuczys 2024-08-28 22:15:58 +02:00 committed by GitHub
parent 34bf026a02
commit aeab0d48fd
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -302,7 +302,7 @@ def deprecated(instead: Optional[str] = None) -> Callable[[Callable[P, T]], Call
else: else:
fmt = '{0.__name__} is deprecated.' fmt = '{0.__name__} is deprecated.'
warnings.warn(fmt.format(func, instead), stacklevel=3, category=DeprecationWarning) warnings.warn(fmt.format(func, instead), stacklevel=2, category=DeprecationWarning)
warnings.simplefilter('default', DeprecationWarning) # reset filter warnings.simplefilter('default', DeprecationWarning) # reset filter
return func(*args, **kwargs) return func(*args, **kwargs)