MNT: set stack level on warnings

This makes it much easier to find where in client code needs to be
fixed.
This commit is contained in:
Thomas A Caswell 2019-10-02 23:44:07 -07:00 committed by Casper da Costa-Luis
parent 1db4511ec4
commit fa2e30fb7f
No known key found for this signature in database
GPG Key ID: 986B408043AE090D
4 changed files with 4 additions and 4 deletions

View File

@ -4,4 +4,4 @@ from .std import TqdmDeprecationWarning
from warnings import warn
warn("This function will be removed in tqdm==5.0.0\n"
"Please use `tqdm.cli.*` instead of `tqdm._main.*`",
TqdmDeprecationWarning)
TqdmDeprecationWarning, stacklevel=2)

View File

@ -4,4 +4,4 @@ from .std import TqdmDeprecationWarning
from warnings import warn
warn("This function will be removed in tqdm==5.0.0\n"
"Please use `tqdm.gui.*` instead of `tqdm._tqdm_gui.*`",
TqdmDeprecationWarning)
TqdmDeprecationWarning, stacklevel=2)

View File

@ -4,4 +4,4 @@ from .std import TqdmDeprecationWarning
from warnings import warn
warn("This function will be removed in tqdm==5.0.0\n"
"Please use `tqdm.notebook.*` instead of `tqdm._tqdm_notebook.*`",
TqdmDeprecationWarning)
TqdmDeprecationWarning, stacklevel=2)

View File

@ -3,4 +3,4 @@ from .std import TqdmDeprecationWarning
from warnings import warn
warn("This function will be removed in tqdm==5.0.0\n"
"Please use `tqdm.utils.*` instead of `tqdm._utils.*`",
TqdmDeprecationWarning)
TqdmDeprecationWarning, stacklevel=2)