Browse Source

python: fix to build with pybind11 2.3.

I should probably reconsider supporting such old versions, but no time
for that now.
next
Vladimír Vondruš 3 years ago
parent
commit
ae5741e4d0
  1. 7
      src/python/corrade/test/test_stridedarrayview.cpp

7
src/python/corrade/test/test_stridedarrayview.cpp

@ -122,7 +122,12 @@ PYBIND11_MODULE(test_stridedarrayview, m) {
setitem = [](char* item, py::handle object) {
*reinterpret_cast<std::pair<short, short>*>(item) = py::cast<std::pair<short, short>>(object);
};
} else throw py::attribute_error{};
} else {
/* py::attribute_error is only since 2.8.1, we're currently
testing all the way back to 2.3 */
PyErr_SetString(PyExc_AttributeError, "");
throw py::error_already_set{};
}
return Containers::pyArrayViewHolder(Containers::PyStridedArrayView<2, char>{Containers::arrayCast<char>(self.view()), self.format.data(), itemsize, getitem, setitem}, py::cast(self));
});

Loading…
Cancel
Save