Skip to content
Snippets Groups Projects
Commit 428859d6 authored by Olivier BICHLER's avatar Olivier BICHLER Committed by Maxence Naud
Browse files

Added handling of None

parent 7ee5febe
No related branches found
No related tags found
2 merge requests!212Version 0.3.0,!167Added handling of None
Pipeline #50632 passed
...@@ -169,7 +169,11 @@ void init_Node(py::module& m) { ...@@ -169,7 +169,11 @@ void init_Node(py::module& m) {
if (pybind11::isinstance<Connector>(arg)) { if (pybind11::isinstance<Connector>(arg)) {
// Convert Python object to C++ object adn push it ot vector // Convert Python object to C++ object adn push it ot vector
connectors.push_back(arg.cast<Connector>()); 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."); throw std::runtime_error("One of the arguments was not a Connector.");
} }
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment