Skip to content

Commit

Permalink
Add 2 missing throw error_already_set(); (#4863)
Browse files Browse the repository at this point in the history
Fixes oversights in PR #4570.
  • Loading branch information
Ralf W. Grosse-Kunstleve authored Sep 27, 2023
1 parent 7e5edbc commit f468b07
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions include/pybind11/detail/internals.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand All @@ -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);
}
Expand Down

0 comments on commit f468b07

Please sign in to comment.