diff --git a/pybind11_protobuf/proto_cast_util.cc b/pybind11_protobuf/proto_cast_util.cc index 11a7704..a098bcb 100644 --- a/pybind11_protobuf/proto_cast_util.cc +++ b/pybind11_protobuf/proto_cast_util.cc @@ -59,8 +59,8 @@ namespace { // Resolves the class name of a descriptor via d->containing_type() py::object ResolveDescriptor(py::object p, const Descriptor* d) { return d->containing_type() ? ResolveDescriptor(p, d->containing_type()) - .attr(py::str(d->name())) - : p.attr(py::str(d->name())); + .attr(py::str(std::string_view(d->name()))) + : p.attr(py::str(std::string_view(d->name()))); } // Returns true if an exception is an import error.