mirror of
https://github.com/pybind/pybind11.git
synced 2025-01-31 15:20:34 +00:00
Reraise existing exception if dtype ctor fails
This commit is contained in:
parent
694269435b
commit
43a88f4574
@ -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);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user