Skip to content

Commit

Permalink
Add handling of return_value_policy::_clif_automatic in type_caster…
Browse files Browse the repository at this point in the history
…_pyobject_ptr.h (backported from google/pybind11clif#30021)
  • Loading branch information
Ralf W. Grosse-Kunstleve committed May 7, 2023
1 parent ba3d14d commit bd69f7a
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion include/pybind11/type_caster_pyobject_ptr.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@ class type_caster<PyObject> {
raise_from(PyExc_SystemError, "src != nullptr but PyErr_Occurred()");
throw error_already_set();
}
if (policy == return_value_policy::take_ownership) {
if (policy == return_value_policy::take_ownership
|| policy == return_value_policy::_clif_automatic) {
return src;
}
if (policy == return_value_policy::reference
Expand Down

0 comments on commit bd69f7a

Please sign in to comment.