1 #include "stl_container_adapter.hpp"
3 #include <boost/python/exception_translator.hpp>
4 using namespace boost::python;
6 void translate_index_error(IndexError const& e)
8 PyErr_SetString(PyExc_IndexError, "Index out of range");
11 void translate_key_error(KeyError const& e)
13 PyErr_SetString(PyExc_KeyError, "Key not found");
16 void export_container_exceptions()
18 boost::python::register_exception_translator<IndexError>(
19 &translate_index_error
22 boost::python::register_exception_translator<KeyError>(