Salome HOME
Fix: getCellsContainingPoints() in case of polyhedron with a face containing colinear...
[tools/medcoupling.git] / src / MEDCoupling_Swig / MEDCouplingDataArrayTypemaps.i
index 27c4949e0fbc94bc154c93e601adee5dfb28b753..9208a72f44867f5702f18c949343429555858eb3 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2021  CEA/DEN, EDF R&D
+// Copyright (C) 2007-2024  CEA, EDF
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
@@ -3147,8 +3147,11 @@ bool isCSRMatrix(PyObject *m)
   PyObject* pdict(PyDict_New());
   PyDict_SetItemString(pdict, "__builtins__", PyEval_GetBuiltins());
   PyObject *tmp(PyRun_String("from scipy.sparse import csr_matrix", Py_single_input, pdict, pdict));
-  if(!tmp)
-    throw INTERP_KERNEL::Exception("Problem during loading csr_matrix in scipy.sparse ! Is Scipy module available in present ?");
+  if (!tmp)
+  {
+    PyErr_Clear(); // Otherwise exception propagation will fail.
+    throw INTERP_KERNEL::Exception("Problem during loading csr_matrix in scipy.sparse! Is Scipy module available and present?");
+  }
   PyObject *csrMatrixCls=PyDict_GetItemString(pdict,"csr_matrix");
   if(!csrMatrixCls)
     throw INTERP_KERNEL::Exception("csr_matrix not found in scipy.sparse ! Is Scipy module available in present ?");