From 9ed042e4aeec30e21813978a2dd0c3e70e8993ef Mon Sep 17 00:00:00 2001 From: vsr Date: Thu, 14 Oct 2021 14:48:44 +0300 Subject: [PATCH] bos #26520 Remove dependency on boost::python --- src/Container/CMakeLists.txt | 4 +--- src/Container/Container_i.cxx | 6 ++++++ 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/Container/CMakeLists.txt b/src/Container/CMakeLists.txt index a289e76cd..77bf4488c 100644 --- a/src/Container/CMakeLists.txt +++ b/src/Container/CMakeLists.txt @@ -22,7 +22,6 @@ INCLUDE_DIRECTORIES( ${PTHREAD_INCLUDE_DIR} ${HDF5_INCLUDE_DIRS} ${PYTHON_INCLUDE_DIRS} - ${Boost_INCLUDE_DIRS} ${PROJECT_BINARY_DIR}/salome_adm ${CMAKE_CURRENT_SOURCE_DIR}/../Basics ${CMAKE_CURRENT_SOURCE_DIR}/../SALOMELocalTrace @@ -45,7 +44,7 @@ SET(SCRIPTS SALOME_ContainerPy.py ) -ADD_DEFINITIONS(${HDF5_DEFINITIONS} ${OMNIORB_DEFINITIONS} ${BOOST_DEFINITIONS}) +ADD_DEFINITIONS(${HDF5_DEFINITIONS} ${OMNIORB_DEFINITIONS}) SET(COMMON_LIBS Registry SalomeNotification @@ -60,7 +59,6 @@ SET(COMMON_LIBS SalomeIDLKernel ${OMNIORB_LIBRARIES} ${PYTHON_LIBRARIES} - ${Boost_PYTHON3_LIBRARY} ) IF(WITH_MPI_SEQ_CONTAINER) diff --git a/src/Container/Container_i.cxx b/src/Container/Container_i.cxx index b196bfac0..e7674b57e 100644 --- a/src/Container/Container_i.cxx +++ b/src/Container/Container_i.cxx @@ -64,7 +64,9 @@ int SIGUSR1 = 1000; #include #include "Container_init_python.hxx" +#ifdef BOS26455_WITH_BOOST_PYTHON #include +#endif bool _Sleeping = false ; @@ -375,6 +377,7 @@ namespace { std::string error; if (PyErr_Occurred()) { +#ifdef BOS26455_WITH_BOOST_PYTHON PyObject *ptype = nullptr; PyObject *pvalue = nullptr; PyObject *ptraceback = nullptr; @@ -391,6 +394,9 @@ namespace { boost::python::object format_exc = traceback.attr("format_exception"); boost::python::object formatted = format_exc(htype, hvalue, htraceback); error = boost::python::extract(boost::python::str("\n").join(formatted)); +#else + error = "Python exception is caught"; +#endif } return error; } -- 2.39.2