]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Disable abort on exception for the python wrappers. 5591/head
authorBruno Turcksin <bruno.turcksin@gmail.com>
Wed, 6 Dec 2017 18:54:56 +0000 (13:54 -0500)
committerBruno Turcksin <bruno.turcksin@gmail.com>
Wed, 6 Dec 2017 20:20:10 +0000 (15:20 -0500)
contrib/python-bindings/source/wrappers.cc

index 0be4354a5a17777ce769c75c6efd880e2fa90d1e..e4535f80fe9763133b69a3660dbdf9d24c4831f8 100644 (file)
@@ -14,6 +14,7 @@
 // ---------------------------------------------------------------------
 
 #include <deal.II/base/config.h>
+#include <deal.II/base/exceptions.h>
 
 #include <boost/python.hpp>
 
@@ -48,6 +49,11 @@ BOOST_PYTHON_MODULE(Debug)
   doc_options.enable_py_signatures();
   doc_options.disable_cpp_signatures();
 
+  // Switch off call to std::abort when an exception is created using Assert.
+  // If the code aborts, the kernel of a Jupyter Notebook is killed and no
+  // message is printed.
+  dealii::deal_II_exceptions::disable_abort_on_exception();
+
   dealii::python::export_cell_accessor();
   dealii::python::export_point();
   dealii::python::export_triangulation();

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.