Skip to content

Commit

Permalink
LSC: Remove deprecated protobuf python MessageFactory.CreatePrototype…
Browse files Browse the repository at this point in the history
…() usages

PiperOrigin-RevId: 683880505
  • Loading branch information
anandolee authored and copybara-github committed Oct 9, 2024
1 parent ed430af commit ac7ffc7
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions pybind11_protobuf/tests/dynamic_message_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand All @@ -42,15 +41,15 @@

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


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
Expand Down

0 comments on commit ac7ffc7

Please sign in to comment.