From f17ed9b5ad84aa12bfb831ddfb2fdda34d1a7653 Mon Sep 17 00:00:00 2001
From: jcarpent <jcarpent@laas.fr>
Date: Wed, 17 Jan 2018 09:34:55 +0100
Subject: [PATCH] [Exception] Fix bug when returning personalized exception

---
 src/exception.cpp | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/src/exception.cpp b/src/exception.cpp
index e67b2987..6a7e6ed3 100644
--- a/src/exception.cpp
+++ b/src/exception.cpp
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015-2016 LAAS-CNRS
+ * Copyright (c) 2015-2018 LAAS-CNRS
  *
  * This file is part of eigenpy.
  * eigenpy is free software: you can redistribute it and/or
@@ -17,6 +17,8 @@
 #include "eigenpy/exception.hpp"
 #include "eigenpy/registration.hpp"
 
+#include <boost/python/exception_translator.hpp>
+
 
 namespace eigenpy
 {
@@ -26,7 +28,7 @@ namespace eigenpy
   {
     assert(NULL!=pyType);
     // Return an exception object of type pyType and value object(e).
-    PyErr_SetObject(Exception::pyType,boost::python::object(e).ptr());
+    PyErr_SetString(PyExc_RuntimeError, e.what());
   }
 
   void Exception::registerException()
-- 
GitLab