diff --git a/python/google/protobuf/pyext/message.cc b/python/google/protobuf/pyext/message.cc index db58df54f..72f51ec18 100644 --- a/python/google/protobuf/pyext/message.cc +++ b/python/google/protobuf/pyext/message.cc @@ -313,7 +313,7 @@ static PyObject* New(PyTypeObject* type, // Add the message to the DescriptorPool. if (cdescriptor_pool::RegisterMessageClass(newtype->py_descriptor_pool, - descriptor, result) < 0) { + descriptor, result.get()) < 0) { return NULL; } @@ -1946,8 +1946,6 @@ static PyObject* RegisterExtension(PyObject* cls, if (descriptor == NULL) { return NULL; } - const Descriptor* cmessage_descriptor = GetMessageDescriptor( - reinterpret_cast(cls)); ScopedPyObjectPtr extensions_by_name( PyObject_GetAttr(cls, k_extensions_by_name));