diff --git a/vlsisapd/dtr/src/PyTechno.cpp b/vlsisapd/dtr/src/PyTechno.cpp index c60459c6..650a3f67 100644 --- a/vlsisapd/dtr/src/PyTechno.cpp +++ b/vlsisapd/dtr/src/PyTechno.cpp @@ -3,8 +3,13 @@ using namespace boost::python; #include "io/dtr/Techno.h" #include "io/dtr/Rules.h" +#include "io/dtr/DTRException.h" namespace DTR { +void translator(DTRException const& e) { + PyErr_SetString(PyExc_UserWarning, e.what()); +} + BOOST_PYTHON_MODULE(pyDTR) { // class DTR::Name class_("Name", init()) @@ -39,5 +44,9 @@ BOOST_PYTHON_MODULE(pyDTR) { .def("getValue" , static_cast(&Techno::getValue)) .def("getValue" , static_cast(&Techno::getValue)) ; + + // DTRException translator + register_exception_translator(translator) + ; } }