From ac7ffc727c3f4bf16d00ba9de3125fcffc6ac109 Mon Sep 17 00:00:00 2001 From: Jie Luo Date: Tue, 8 Oct 2024 21:35:00 -0700 Subject: [PATCH] LSC: Remove deprecated protobuf python MessageFactory.CreatePrototype() usages PiperOrigin-RevId: 683880505 --- pybind11_protobuf/tests/dynamic_message_test.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/pybind11_protobuf/tests/dynamic_message_test.py b/pybind11_protobuf/tests/dynamic_message_test.py index 0122338..1ac4641 100644 --- a/pybind11_protobuf/tests/dynamic_message_test.py +++ b/pybind11_protobuf/tests/dynamic_message_test.py @@ -19,7 +19,6 @@ from pybind11_protobuf.tests import test_pb2 POOL = descriptor_pool.DescriptorPool() -FACTORY = message_factory.MessageFactory(POOL) POOL.Add( descriptor_pb2.FileDescriptorProto( name='pybind11_protobuf/tests', @@ -42,7 +41,7 @@ def get_py_dynamic_message(value=5): """Returns a dynamic message that is wire-compatible with IntMessage.""" - prototype = FACTORY.CreatePrototype( + prototype = message_factory.GetMessageClass( POOL.FindMessageTypeByName('pybind11.test.DynamicMessage')) msg = prototype(value=value) return msg @@ -50,7 +49,7 @@ def get_py_dynamic_message(value=5): def get_py_dynamic_int_message(value=5): """Returns a dynamic message named pybind11.test.IntMessage.""" - prototype = FACTORY.CreatePrototype( + prototype = message_factory.GetMessageClass( POOL.FindMessageTypeByName('pybind11.test.IntMessage')) msg = prototype(value=value) return msg