Skip to content

Commit b0e7b98

Browse files
committed
Correctly throw an exception if PyErr was set
1 parent 29e4638 commit b0e7b98

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

include/pybind11/detail/smart_holder_type_casters.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -632,7 +632,7 @@ struct smart_holder_type_caster<std::shared_ptr<T>> : smart_holder_type_caster_l
632632
auto src_raw_ptr = src.get();
633633
auto st = type_caster_base<T>::src_and_type(src_raw_ptr);
634634
if (st.first == nullptr)
635-
return none().release(); // PyErr was set already.
635+
throw error_already_set();
636636

637637
void *src_raw_void_ptr = static_cast<void *>(src_raw_ptr);
638638
const detail::type_info *tinfo = st.second;

0 commit comments

Comments
 (0)