Skip to content

OpenVINO™ is an open source toolkit for optimizing and deploying AI inference

[Py OV] Change simplefilter to filterwarnings in ov.runtime (#28905)

Alicja Miloszewska6aa2544e6912
diff --git a/src/bindings/python/src/openvino/runtime/__init__.py b/src/bindings/python/src/openvino/runtime/__init__.py
index 431689eee27..33421a07a05 100644
--- a/src/bindings/python/src/openvino/runtime/__init__.py
+++ b/src/bindings/python/src/openvino/runtime/__init__.py
@@ -6,12 +6,12 @@
# noqa: F401
import warnings
-warnings.simplefilter("always", DeprecationWarning)
+warnings.filterwarnings("once", category=DeprecationWarning, module="openvino.runtime")
warnings.warn(
"The `openvino.runtime` module is deprecated and will be removed in the 2026.0 release. "
"Please replace `openvino.runtime` with `openvino`.",
DeprecationWarning,
- stacklevel=2
+ stacklevel=1
)