Skip to content

Commit 8f9b2f7

Browse files
committed
explicit stacklevel for warn
1 parent b61b7f1 commit 8f9b2f7

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/cryptojwt/jwx.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ def __init__(self, msg=None, with_digest=False, httpc=None, **kwargs):
9595
else:
9696
self._dict[key] = _val
9797
if key in DEPRECATED and _val in DEPRECATED[key]:
98-
warnings.warn(f"{key}={_val} deprecated")
98+
warnings.warn(f"{key}={_val} deprecated", stacklevel=1)
9999

100100
def _set_jwk(self, val):
101101
if isinstance(val, dict):

src/cryptojwt/utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,7 @@ def rename_kwargs(func_name, kwargs, aliases):
251251
if alias in kwargs:
252252
if new in kwargs:
253253
raise TypeError(f"{func_name} received both {alias} and {new}")
254-
warnings.warn(f"{alias} is deprecated; use {new}", DeprecationWarning)
254+
warnings.warn(f"{alias} is deprecated; use {new}", DeprecationWarning, stacklevel=1)
255255
kwargs[new] = kwargs.pop(alias)
256256

257257

0 commit comments

Comments
 (0)