From 941b6dd7037d57cf36d5084ffdba0a20b1657f34 Mon Sep 17 00:00:00 2001 From: Jie Luo Date: Tue, 15 Aug 2023 10:39:34 -0700 Subject: [PATCH] upb python CopyFrom() back to Serialize and Pasre wrap for https://github.com/protocolbuffers/protobuf/issues/13485 We will go forward with memory copy in 25.0 PiperOrigin-RevId: 557178075 --- python/message.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/python/message.c b/python/message.c index c774c6fe5d..41eb9bb16a 100644 --- a/python/message.c +++ b/python/message.c @@ -1658,8 +1658,11 @@ static PyMethodDef PyUpb_Message_Methods[] = { {"ClearExtension", PyUpb_Message_ClearExtension, METH_O, "Clears a message field."}, {"ClearField", PyUpb_Message_ClearField, METH_O, "Clears a message field."}, +#ifndef PROTO2_OPENSOURCE + // TODO(b/296078718): add the CopyFrom back when we are able to repo {"CopyFrom", PyUpb_Message_CopyFrom, METH_O, "Copies a protocol message into the current message."}, +#endif // !PROTO2_OPENSOURCE {"DiscardUnknownFields", (PyCFunction)PyUpb_Message_DiscardUnknownFields, METH_NOARGS, "Discards the unknown fields."}, {"FindInitializationErrors", PyUpb_Message_FindInitializationErrors,