Reraise existing exception if dtype ctor fails

This commit is contained in:
Ivan Smirnov 2016-10-22 10:52:05 +01:00 committed by Wenzel Jakob
parent 694269435b
commit 43a88f4574

View File

@ -189,7 +189,7 @@ public:
static dtype from_args(object args) { static dtype from_args(object args) {
PyObject *ptr = nullptr; PyObject *ptr = nullptr;
if (!detail::npy_api::get().PyArray_DescrConverter_(args.release().ptr(), &ptr) || !ptr) 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); return object(ptr, false);
} }