Skip to content

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

[PyOV] Fix a dangling pointer in raise_not_implemented (#30669)

Anastasia Kuporosova300467051eb8
diff --git a/src/bindings/python/src/pyopenvino/utils/utils.cpp b/src/bindings/python/src/pyopenvino/utils/utils.cpp
index c27609e167a..2b0deba8535 100644
--- a/src/bindings/python/src/pyopenvino/utils/utils.cpp
+++ b/src/bindings/python/src/pyopenvino/utils/utils.cpp
@@ -388,8 +388,7 @@ void deprecation_warning(const std::string& function_name,
}
void raise_not_implemented() {
- auto error_message = py::detail::c_str(std::string("This function is not implemented."));
- PyErr_SetString(PyExc_NotImplementedError, error_message);
+ PyErr_SetString(PyExc_NotImplementedError, "This function is not implemented.");
throw py::error_already_set();
}