Skip to content
Snippets Groups Projects
Commit 786bd2ae authored by Maxence Naud's avatar Maxence Naud
Browse files

Merge branch 'inc_connector' into 'dev'

Added handling of None

See merge request !167
parents 7ee5febe 428859d6
No related branches found
No related tags found
2 merge requests!212Version 0.3.0,!167Added handling of None
Pipeline #50642 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