aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorwim glenn <hey@wimglenn.com>2021-09-30 10:14:34 -0500
committerwim glenn <hey@wimglenn.com>2021-09-30 10:14:34 -0500
commitd2297fe1c606d512fc544cf53604ba8ee3c8324b (patch)
tree1a08582d7fba4a93bc5bc6a1b1ed0f1206cd81c7
parent8b9bbc4b60429bd73a06ff54a8eefd141215acc2 (diff)
downloadcachetools-d2297fe1c606d512fc544cf53604ba8ee3c8324b.tar.gz
use stacklevel=2 for deprecation warnings, so the source/line number of the user code is indicated
-rw-r--r--src/cachetools/cache.py4
-rw-r--r--src/cachetools/fifo.py4
-rw-r--r--src/cachetools/lfu.py4
-rw-r--r--src/cachetools/lru.py4
-rw-r--r--src/cachetools/mru.py4
-rw-r--r--src/cachetools/rr.py4
-rw-r--r--src/cachetools/ttl.py4
7 files changed, 21 insertions, 7 deletions
diff --git a/src/cachetools/cache.py b/src/cachetools/cache.py
index 8c9dfd7..ee5269d 100644
--- a/src/cachetools/cache.py
+++ b/src/cachetools/cache.py
@@ -3,5 +3,7 @@ import warnings
from . import Cache
warnings.warn(
- "cachetools.cache is deprecated, please use cachetools.Cache", DeprecationWarning
+ "cachetools.cache is deprecated, please use cachetools.Cache",
+ DeprecationWarning,
+ stacklevel=2,
)
diff --git a/src/cachetools/fifo.py b/src/cachetools/fifo.py
index ec072cd..a29b789 100644
--- a/src/cachetools/fifo.py
+++ b/src/cachetools/fifo.py
@@ -3,5 +3,7 @@ import warnings
from . import FIFOCache
warnings.warn(
- "cachetools.fifo is deprecated, please use cachetools.FIFOCache", DeprecationWarning
+ "cachetools.fifo is deprecated, please use cachetools.FIFOCache",
+ DeprecationWarning,
+ stacklevel=2,
)
diff --git a/src/cachetools/lfu.py b/src/cachetools/lfu.py
index 44514ac..5c9acef 100644
--- a/src/cachetools/lfu.py
+++ b/src/cachetools/lfu.py
@@ -3,5 +3,7 @@ import warnings
from . import LFUCache
warnings.warn(
- "cachetools.lfu is deprecated, please use cachetools.LFUCache", DeprecationWarning
+ "cachetools.lfu is deprecated, please use cachetools.LFUCache",
+ DeprecationWarning,
+ stacklevel=2,
)
diff --git a/src/cachetools/lru.py b/src/cachetools/lru.py
index 5d557b0..48ddb36 100644
--- a/src/cachetools/lru.py
+++ b/src/cachetools/lru.py
@@ -3,5 +3,7 @@ import warnings
from . import LRUCache
warnings.warn(
- "cachetools.lru is deprecated, please use cachetools.LRUCache", DeprecationWarning
+ "cachetools.lru is deprecated, please use cachetools.LRUCache",
+ DeprecationWarning,
+ stacklevel=2,
)
diff --git a/src/cachetools/mru.py b/src/cachetools/mru.py
index 0714bdc..a486dc4 100644
--- a/src/cachetools/mru.py
+++ b/src/cachetools/mru.py
@@ -3,5 +3,7 @@ import warnings
from . import MRUCache
warnings.warn(
- "cachetools.mru is deprecated, please use cachetools.MRUCache", DeprecationWarning
+ "cachetools.mru is deprecated, please use cachetools.MRUCache",
+ DeprecationWarning,
+ stacklevel=2,
)
diff --git a/src/cachetools/rr.py b/src/cachetools/rr.py
index f49e185..81331bc 100644
--- a/src/cachetools/rr.py
+++ b/src/cachetools/rr.py
@@ -3,5 +3,7 @@ import warnings
from . import RRCache
warnings.warn(
- "cachetools.rr is deprecated, please use cachetools.RRCache", DeprecationWarning
+ "cachetools.rr is deprecated, please use cachetools.RRCache",
+ DeprecationWarning,
+ stacklevel=2,
)
diff --git a/src/cachetools/ttl.py b/src/cachetools/ttl.py
index d96b677..ef343da 100644
--- a/src/cachetools/ttl.py
+++ b/src/cachetools/ttl.py
@@ -3,5 +3,7 @@ import warnings
from . import TTLCache
warnings.warn(
- "cachetools.ttl is deprecated, please use cachetools.TTLCache", DeprecationWarning
+ "cachetools.ttl is deprecated, please use cachetools.TTLCache",
+ DeprecationWarning,
+ stacklevel=2,
)