don't allow registering a class twice (fixes #218)

This commit is contained in:
Wenzel Jakob
2016-05-31 09:53:28 +02:00
parent 5eda97d7e4
commit 38d8b8cfe2
3 changed files with 18 additions and 3 deletions

View File

@@ -131,4 +131,11 @@ void init_issues(py::module &m) {
.def("f", &A::f);
m2.def("call_f", call_f);
try {
py::class_<Placeholder>(m2, "Placeholder");
throw std::logic_error("Expected an exception!");
} catch (std::runtime_error &e) {
/* All good */
}
}