From fa2e30fb7f83f8b82eccbc01980eed5d0ceaff53 Mon Sep 17 00:00:00 2001 From: Thomas A Caswell Date: Wed, 2 Oct 2019 23:44:07 -0700 Subject: [PATCH] MNT: set stack level on warnings This makes it much easier to find where in client code needs to be fixed. --- tqdm/_main.py | 2 +- tqdm/_tqdm_gui.py | 2 +- tqdm/_tqdm_notebook.py | 2 +- tqdm/_utils.py | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/tqdm/_main.py b/tqdm/_main.py index ec5cd7a0..07b6730b 100644 --- a/tqdm/_main.py +++ b/tqdm/_main.py @@ -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) diff --git a/tqdm/_tqdm_gui.py b/tqdm/_tqdm_gui.py index f31a2483..541f104f 100644 --- a/tqdm/_tqdm_gui.py +++ b/tqdm/_tqdm_gui.py @@ -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) diff --git a/tqdm/_tqdm_notebook.py b/tqdm/_tqdm_notebook.py index d424112f..dde99981 100644 --- a/tqdm/_tqdm_notebook.py +++ b/tqdm/_tqdm_notebook.py @@ -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) diff --git a/tqdm/_utils.py b/tqdm/_utils.py index 1c01ad05..31f78ed7 100644 --- a/tqdm/_utils.py +++ b/tqdm/_utils.py @@ -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)