Exception Translation from C++ to Python with Boost.Python Scenario Say we have written a Python binding with Boost.Python. Something like following code. // some.cpp # include <stdexcept> # include <boost/python.hpp> struct my_exception : std :: exception { my_exception ( int extra_info ) : extra_info ( extra_info ) { } char const * what ( ) noexcept ( true ) { return "My exception" ; } int const extra_info ; } ; void do_throw ( ) { throw my_exception ( ) ; } // Something should be done here ... BOOST_PYTHON_MODULE ( MyLib ) { using namespace boost :: python ; def ( "do_throw" , & do_throw ) ; } And we wish to catch a Python exception object in Python code, e.g. import MyLib try : MyLib . do_throw ( ) except MyLib . MyException as e : print e , e . extra_info pass The situation is, we can’t directly pass the exception object, my_exception,...