Add handling of return_value_policy::_clif_automatic in type_caster_pyobject_ptr.h (backported from https://github.com/google/pywrapcc/pull/30021)

This commit is contained in:
Ralf W. Grosse-Kunstleve 2023-05-07 10:41:21 -07:00
parent ba3d14d4c6
commit bd69f7aaf2

View File

@ -32,7 +32,8 @@ public:
raise_from(PyExc_SystemError, "src != nullptr but PyErr_Occurred()"); raise_from(PyExc_SystemError, "src != nullptr but PyErr_Occurred()");
throw error_already_set(); 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; return src;
} }
if (policy == return_value_policy::reference if (policy == return_value_policy::reference