From 6aa2544e6912534f4ebb1dced34efb2d88afba98 Mon Sep 17 00:00:00 2001 From: Alicja Miloszewska Date: Thu, 13 Feb 2025 06:43:47 +0100 Subject: [PATCH] [Py OV] Change simplefilter to filterwarnings in ov.runtime (#28905) ### Details: - *item1* - previous warning: ![Screenshot 2025-01-10 114701](https://github.com/user-attachments/assets/0a027a16-350f-491c-8c70-a71f146348f1) - current warning: ![warn-feb10-interactive](https://github.com/user-attachments/assets/d8c4821d-0b9a-4062-8598-aad8320ddede) ### Tickets: - *ticket-id* Signed-off-by: Alicja Miloszewska --- src/bindings/python/src/openvino/runtime/__init__.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/bindings/python/src/openvino/runtime/__init__.py b/src/bindings/python/src/openvino/runtime/__init__.py index 431689eee27dea..33421a07a05933 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 )