Commit 43a88f45 by Ivan Smirnov Committed by Wenzel Jakob

Reraise existing exception if dtype ctor fails

parent 69426943
...@@ -189,7 +189,7 @@ public: ...@@ -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);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment