diff --git a/include/pybind11/type_caster_pyobject_ptr.h b/include/pybind11/type_caster_pyobject_ptr.h index 7789c0401..aa914f9e1 100644 --- a/include/pybind11/type_caster_pyobject_ptr.h +++ b/include/pybind11/type_caster_pyobject_ptr.h @@ -32,8 +32,7 @@ public: raise_from(PyExc_SystemError, "src != nullptr but PyErr_Occurred()"); throw error_already_set(); } - if (policy == return_value_policy::take_ownership - || policy == return_value_policy::_clif_automatic) { + if (policy == return_value_policy::take_ownership) { return src; } if (policy == return_value_policy::reference