diff --git a/src/nwbinspector/inspector_tools/__init__.py b/src/nwbinspector/inspector_tools/__init__.py index 6fa9d0933..f4df3ee28 100644 --- a/src/nwbinspector/inspector_tools/__init__.py +++ b/src/nwbinspector/inspector_tools/__init__.py @@ -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 diff --git a/src/nwbinspector/nwbinspector/__init__.py b/src/nwbinspector/nwbinspector/__init__.py index db27f589c..5a5552154 100644 --- a/src/nwbinspector/nwbinspector/__init__.py +++ b/src/nwbinspector/nwbinspector/__init__.py @@ -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