@@ -40,20 +40,24 @@ struct proto_caster_load_impl {
40
40
41
41
// load converts from Python -> C++
42
42
bool load (pybind11::handle src, bool convert) {
43
+ LOG (ERROR) << 1 ;
43
44
// When given a none, treat it as a nullptr.
44
45
if (src.is_none ()) {
45
46
value = nullptr ;
46
47
return true ;
47
48
}
49
+ LOG (ERROR) << 1 ;
48
50
// NOTE: We might need to know whether the proto has extensions that
49
51
// are python-only.
50
52
51
53
// Attempt to use the PyProto_API to get an underlying C++ message pointer
52
54
// from the object.
53
55
const ::google::protobuf::Message *message =
54
56
pybind11_protobuf::PyProtoGetCppMessagePointer (src);
57
+ LOG (ERROR) << 1 ;
55
58
if (message && message->GetReflection () ==
56
59
ProtoType::default_instance ().GetReflection ()) {
60
+ LOG (ERROR) << 1 ;
57
61
// If the capability were available, then we could probe PyProto_API and
58
62
// allow c++ mutability based on the python reference count.
59
63
value = static_cast <const ProtoType *>(message);
@@ -62,13 +66,17 @@ struct proto_caster_load_impl {
62
66
63
67
// The incoming object is not a compatible fast_cpp_proto, so check whether
64
68
// it is otherwise compatible, then serialize it and deserialize into a
69
+ LOG (ERROR) << 1 ;
65
70
// native C++ proto type.
66
71
if (!pybind11_protobuf::PyProtoIsCompatible (src,
67
72
ProtoType::GetDescriptor ())) {
73
+ LOG (ERROR) << 1 ;
68
74
return false ;
69
75
}
76
+ LOG (ERROR) << 1 ;
70
77
owned = std::unique_ptr<ProtoType>(new ProtoType ());
71
78
value = owned.get ();
79
+ LOG (ERROR) << 1 ;
72
80
return pybind11_protobuf::PyProtoCopyToCProto (src, owned.get ());
73
81
}
74
82
0 commit comments