Rename CMessage -> Message, to make the change in https://github.com/protocolbuffers/upb/pull/617 work as intended.
The previous change did not have the desired effect, because the generated code uses the class named "Message" instead of "CMessage."
There was no real need to use the class "CMessage" instead of "Message." The new name is simpler and will make the previous change work.
PiperOrigin-RevId: 449309343
diff --git a/python/descriptor_pool.c b/python/descriptor_pool.c
index b8ca06d..ea0e813 100644
--- a/python/descriptor_pool.c
+++ b/python/descriptor_pool.c
@@ -217,7 +217,7 @@
goto done;
}
const upb_MessageDef* m = PyUpb_DescriptorPool_GetFileProtoDef();
- if (PyUpb_Message_IsEqual(proto, existing, m)) {
+ if (upb_Message_IsEqual(proto, existing, m)) {
Py_INCREF(Py_None);
result = Py_None;
goto done;
@@ -249,8 +249,8 @@
static PyObject* PyUpb_DescriptorPool_DoAdd(PyObject* _self,
PyObject* file_desc) {
- if (!PyUpb_CMessage_Verify(file_desc)) return NULL;
- const upb_MessageDef* m = PyUpb_CMessage_GetMsgdef(file_desc);
+ if (!PyUpb_Message_Verify(file_desc)) return NULL;
+ const upb_MessageDef* m = PyUpb_Message_GetMsgdef(file_desc);
const char* file_proto_name =
PYUPB_DESCRIPTOR_PROTO_PACKAGE ".FileDescriptorProto";
if (strcmp(upb_MessageDef_FullName(m), file_proto_name) != 0) {
@@ -259,7 +259,7 @@
PyObject* subargs = PyTuple_New(0);
if (!subargs) return NULL;
PyObject* serialized =
- PyUpb_CMessage_SerializeToString(file_desc, subargs, NULL);
+ PyUpb_Message_SerializeToString(file_desc, subargs, NULL);
Py_DECREF(subargs);
if (!serialized) return NULL;
PyObject* ret = PyUpb_DescriptorPool_DoAddSerializedFile(_self, serialized);