diff --git a/include/pybind11/numpy.h b/include/pybind11/numpy.h index 1dc2d04b9..4111ccd7b 100644 --- a/include/pybind11/numpy.h +++ b/include/pybind11/numpy.h @@ -189,7 +189,7 @@ public: static dtype from_args(object args) { PyObject *ptr = nullptr; if (!detail::npy_api::get().PyArray_DescrConverter_(args.release().ptr(), &ptr) || !ptr) - pybind11_fail("NumPy: failed to create structured dtype"); + throw error_already_set(); return object(ptr, false); }