Add 2 missing throw error_already_set(); (#4863)

Fixes oversights in PR #4570.
This commit is contained in:
Ralf W. Grosse-Kunstleve 2023-09-27 09:55:49 -07:00 committed by GitHub
parent 7e5edbc947
commit f468b0707e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -451,6 +451,7 @@ inline object get_python_state_dict() {
#endif
if (!state_dict) {
raise_from(PyExc_SystemError, "pybind11::detail::get_python_state_dict() FAILED");
throw error_already_set();
}
return state_dict;
}
@ -463,6 +464,7 @@ inline internals **get_internals_pp_from_capsule(handle obj) {
void *raw_ptr = PyCapsule_GetPointer(obj.ptr(), /*name=*/nullptr);
if (raw_ptr == nullptr) {
raise_from(PyExc_SystemError, "pybind11::detail::get_internals_pp_from_capsule() FAILED");
throw error_already_set();
}
return static_cast<internals **>(raw_ptr);
}