Skip to content

Commit bd69f7a

Browse files
committed
Add handling of return_value_policy::_clif_automatic in type_caster_pyobject_ptr.h (backported from google/pybind11clif#30021)
1 parent ba3d14d commit bd69f7a

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

include/pybind11/type_caster_pyobject_ptr.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,8 @@ class type_caster<PyObject> {
3232
raise_from(PyExc_SystemError, "src != nullptr but PyErr_Occurred()");
3333
throw error_already_set();
3434
}
35-
if (policy == return_value_policy::take_ownership) {
35+
if (policy == return_value_policy::take_ownership
36+
|| policy == return_value_policy::_clif_automatic) {
3637
return src;
3738
}
3839
if (policy == return_value_policy::reference

0 commit comments

Comments
 (0)