Skip to content

Commit 4ac531c

Browse files
rwgkcopybara-github
authored andcommitted
pybind11_protobuf/proto_cast_util.cc return_value_policy::_clif_automatic -> copy
PiperOrigin-RevId: 491792074
1 parent a50899c commit 4ac531c

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

pybind11_protobuf/proto_cast_util.cc

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -704,6 +704,14 @@ std::string ReturnValuePolicyName(py::return_value_policy policy) {
704704
return "reference";
705705
case py::return_value_policy::reference_internal:
706706
return "reference_internal";
707+
#if defined(PYBIND11_HAS_RETURN_VALUE_POLICY_RETURN_AS_BYTES)
708+
case py::return_value_policy::_return_as_bytes:
709+
return "_return_as_bytes";
710+
#endif
711+
#if defined(PYBIND11_HAS_RETURN_VALUE_POLICY_CLIF_AUTOMATIC)
712+
case py::return_value_policy::_clif_automatic:
713+
return "_clif_automatic";
714+
#endif
707715
default:
708716
return "INVALID_ENUM_VALUE";
709717
}
@@ -753,6 +761,10 @@ py::handle GenericFastCppProtoCast(Message* src, py::return_value_policy policy,
753761
return result.release();
754762
} break;
755763

764+
#if defined(PYBIND11_HAS_RETURN_VALUE_POLICY_CLIF_AUTOMATIC)
765+
// TODO(clif-team): Review this choice for `_clif_automatic`.
766+
case py::return_value_policy::_clif_automatic:
767+
#endif
756768
case py::return_value_policy::copy: {
757769
std::pair<py::object, Message*> descriptor_pair =
758770
GlobalState::instance()->PyFastCppProtoMessageInstance(

0 commit comments

Comments
 (0)