Skip to content

Commit f468b07

Browse files
authored
Add 2 missing throw error_already_set(); (#4863)
Fixes oversights in PR #4570.
1 parent 7e5edbc commit f468b07

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

include/pybind11/detail/internals.h

+2
Original file line numberDiff line numberDiff line change
@@ -451,6 +451,7 @@ inline object get_python_state_dict() {
451451
#endif
452452
if (!state_dict) {
453453
raise_from(PyExc_SystemError, "pybind11::detail::get_python_state_dict() FAILED");
454+
throw error_already_set();
454455
}
455456
return state_dict;
456457
}
@@ -463,6 +464,7 @@ inline internals **get_internals_pp_from_capsule(handle obj) {
463464
void *raw_ptr = PyCapsule_GetPointer(obj.ptr(), /*name=*/nullptr);
464465
if (raw_ptr == nullptr) {
465466
raise_from(PyExc_SystemError, "pybind11::detail::get_internals_pp_from_capsule() FAILED");
467+
throw error_already_set();
466468
}
467469
return static_cast<internals **>(raw_ptr);
468470
}

0 commit comments

Comments
 (0)