Skip to content

Commit e034663

Browse files
committed
fix: set explicit stacklevel on warnings
1 parent 7b88ba6 commit e034663

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

caso/extract/manager.py

+2
Original file line numberDiff line numberDiff line change
@@ -178,12 +178,14 @@ def voms_map(self):
178178
"Using deprecated 'tenant' mapping, please "
179179
"use 'projects' instead",
180180
DeprecationWarning,
181+
stacklevel=2,
181182
)
182183
if tenants:
183184
warnings.warn(
184185
"Using deprecated 'tenants' mapping, please "
185186
"use 'projects' instead",
186187
DeprecationWarning,
188+
stacklevel=2,
187189
)
188190
tenants.append(tenant)
189191
projects = vomap.get("projects", tenants)

caso/messenger/ssm.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -182,5 +182,5 @@ def __init__(self):
182182
"'ssm' as messenger instead in order to use the latest "
183183
"version."
184184
)
185-
warnings.warn(msg, DeprecationWarning)
185+
warnings.warn(msg, DeprecationWarning, stacklevel=2)
186186
super(SSMMessengerV04, self).__init__()

0 commit comments

Comments
 (0)