mirror of
https://github.com/boostorg/python.git
synced 2026-01-23 05:42:30 +00:00
improved error reporting
[SVN r8400]
This commit is contained in:
@@ -11,9 +11,21 @@ namespace py = boost::python;
|
||||
|
||||
extern "C" void initm2()
|
||||
{
|
||||
py::module_builder m2("m2");
|
||||
|
||||
py::class_builder<M2> m2_class(m2, "M2");
|
||||
m2_class.def(py::constructor<>());
|
||||
m2_class.declare_base(py::type<Shared>());
|
||||
try {
|
||||
py::module_builder m2("m2");
|
||||
|
||||
py::class_builder<M2> m2_class(m2, "M2");
|
||||
m2_class.def(py::constructor<>());
|
||||
try {
|
||||
m2_class.declare_base(py::type<Shared>());
|
||||
}
|
||||
catch(std::runtime_error & )
|
||||
{
|
||||
throw std::runtime_error("You must load module `shared' before module `m2'");
|
||||
}
|
||||
}
|
||||
catch(...)
|
||||
{
|
||||
py::handle_exception();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user