Skip to content
Snippets Groups Projects

Added handling of None

Merged Olivier BICHLER requested to merge inc_connector into dev
1 file
+ 5
1
Compare changes
  • Side-by-side
  • Inline
@@ -169,7 +169,11 @@ void init_Node(py::module& m) {
if (pybind11::isinstance<Connector>(arg)) {
// Convert Python object to C++ object adn push it ot vector
connectors.push_back(arg.cast<Connector>());
} else {
}
else if (arg.is(py::none())) {
connectors.push_back(Connector());
}
else {
throw std::runtime_error("One of the arguments was not a Connector.");
}
}
Loading