mirror of
https://github.com/aiogram/aiogram.git
synced 2026-04-08 16:37:47 +00:00
More detailed exceptions.
This commit is contained in:
parent
8cac7c3303
commit
5571f3d4ec
4 changed files with 205 additions and 10 deletions
|
|
@ -69,7 +69,7 @@ def deprecated(reason):
|
|||
raise TypeError(repr(type(reason)))
|
||||
|
||||
|
||||
def warn_deprecated(message, warning=DeprecationWarning):
|
||||
def warn_deprecated(message, warning=DeprecationWarning, stacklevel=2):
|
||||
warnings.simplefilter('always', warning)
|
||||
warnings.warn(message, category=warning, stacklevel=2)
|
||||
warnings.warn(message, category=warning, stacklevel=stacklevel)
|
||||
warnings.simplefilter('default', warning)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue