From bbf7f1d62f93c4d41fb00367fe339a568c6d22d1 Mon Sep 17 00:00:00 2001 From: Jie Luo Date: Fri, 11 Oct 2024 11:37:25 -0700 Subject: [PATCH] LSC: Remove deprecated protobuf python MessageFactory.CreatePrototype() usages PiperOrigin-RevId: 684904603 --- pybind11_protobuf/tests/dynamic_message_test.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/pybind11_protobuf/tests/dynamic_message_test.py b/pybind11_protobuf/tests/dynamic_message_test.py index 0122338..a37730b 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,16 +41,18 @@ def get_py_dynamic_message(value=5): """Returns a dynamic message that is wire-compatible with IntMessage.""" - prototype = FACTORY.CreatePrototype( - POOL.FindMessageTypeByName('pybind11.test.DynamicMessage')) + prototype = message_factory.GetMessageClass( + POOL.FindMessageTypeByName('pybind11.test.DynamicMessage') + ) msg = prototype(value=value) return msg def get_py_dynamic_int_message(value=5): """Returns a dynamic message named pybind11.test.IntMessage.""" - prototype = FACTORY.CreatePrototype( - POOL.FindMessageTypeByName('pybind11.test.IntMessage')) + prototype = message_factory.GetMessageClass( + POOL.FindMessageTypeByName('pybind11.test.IntMessage') + ) msg = prototype(value=value) return msg