diff --git a/Plugin/src/SofaPython3/PythonEnvironment.cpp b/Plugin/src/SofaPython3/PythonEnvironment.cpp index d15d6dee..92b48130 100644 --- a/Plugin/src/SofaPython3/PythonEnvironment.cpp +++ b/Plugin/src/SofaPython3/PythonEnvironment.cpp @@ -270,7 +270,8 @@ void executePython_(const T& emitter, std::function cb) std::stringstream tmp; tmp << "Unable to execute code." << msgendl << "Python exception:" << msgendl - << " " << e.what(); + << " " << e.what() + << PythonEnvironment::getPythonCallingPointString(); msg_error(emitter) << tmp.str(); } } diff --git a/bindings/Sofa/src/SofaPython3/Sofa/Core/Binding_DataEngine.cpp b/bindings/Sofa/src/SofaPython3/Sofa/Core/Binding_DataEngine.cpp index 8c27e9f6..427666ce 100644 --- a/bindings/Sofa/src/SofaPython3/Sofa/Core/Binding_DataEngine.cpp +++ b/bindings/Sofa/src/SofaPython3/Sofa/Core/Binding_DataEngine.cpp @@ -59,14 +59,11 @@ void DataEngine_Trampoline::doUpdate() { PythonEnvironment::executePython(this, [this](){ py::object self = py::cast(this); - if (py::hasattr(self, "update")) { + if (py::hasattr(self, "update")) + { py::object fct = self.attr("update"); - try { - fct(); - return; - } catch (std::exception& /*e*/) { - throw py::type_error(this->getName() + ": The DataEngine requires an update method with no parameter and no return type"); - } + fct(); + return; } throw py::type_error(this->getName() + " has no update() method."); });