]> SALOME platform Git repositories - modules/kernel.git/commitdiff
Salome HOME
bos #26520 Remove dependency on boost::python
authorvsr <vsr@opencascade.com>
Thu, 14 Oct 2021 11:48:44 +0000 (14:48 +0300)
committervsr <vsr@opencascade.com>
Thu, 14 Oct 2021 11:48:44 +0000 (14:48 +0300)
src/Container/CMakeLists.txt
src/Container/Container_i.cxx

index a289e76cda8c991285a4911051aa9c3d597f488d..77bf4488c82c81e0a53018f06348a4863aecef7f 100644 (file)
@@ -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)
index b196bfac0ed28e38ae5e653f52ee6551e70afcc0..e7674b57e2c59520e4a4e81e9d116cf2cdc6e453 100644 (file)
@@ -64,7 +64,9 @@ int SIGUSR1 = 1000;
 
 #include <Python.h>
 #include "Container_init_python.hxx"
+#ifdef BOS26455_WITH_BOOST_PYTHON
 #include <boost/python.hpp>
+#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<std::string>(boost::python::str("\n").join(formatted));
+#else
+      error = "Python exception is caught";
+#endif
     }
     return error;
   }