mirror of
https://github.com/RYDE-WORK/pybind11.git
synced 2026-02-04 06:23:30 +08: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…
x
Reference in New Issue
Block a user