Skip to content

Commit

Permalink
add stacklevel to soft deprecation warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
stephprince authored Aug 13, 2024
1 parent c2d13e1 commit 59e22fe
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/nwbinspector/inspector_tools/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"Please import the helper functions from the top-level package."
)

warnings.warn(message=message, category=DeprecationWarning)
warnings.warn(message=message, category=DeprecationWarning, stacklevel=2)

# Still keep imports functional with warning for soft deprecation cycle
# TODO: remove after 9/15/2024
Expand Down
2 changes: 1 addition & 1 deletion src/nwbinspector/nwbinspector/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

message = "The 'inspector_tools' submodule has been deprecated. Please import the helper functions from the top-level package."

warnings.warn(message=message, category=DeprecationWarning)
warnings.warn(message=message, category=DeprecationWarning, stacklevel=2)

# Still keep imports functional with warning for soft deprecation cycle
# TODO: remove after 9/15/2024
Expand Down

0 comments on commit 59e22fe

Please sign in to comment.